mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
workflows/pr: refactor base/head branch decision making
Some jobs purposefully only run on certain base or head branches. By
centralizing the logic, parts of it can easily be re-used later. Also,
this gives them an explicit name and thus makes them easier to
understand.
(cherry picked from commit 7763be5a80)
This commit is contained in:
committed by
github-actions[bot]
parent
45b63d2695
commit
9a42b59630
11
.github/workflows/check.yml
vendored
11
.github/workflows/check.yml
vendored
@@ -2,6 +2,10 @@ name: Check
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
baseBranch:
|
||||
required: true
|
||||
type: string
|
||||
|
||||
permissions: {}
|
||||
|
||||
@@ -12,9 +16,7 @@ defaults:
|
||||
jobs:
|
||||
no-channel-base:
|
||||
name: no channel base
|
||||
if: |
|
||||
startsWith(github.base_ref, 'nixos-') ||
|
||||
startsWith(github.base_ref, 'nixpkgs-')
|
||||
if: contains(fromJSON(inputs.baseBranch).type, 'channel')
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- run: |
|
||||
@@ -29,8 +31,7 @@ jobs:
|
||||
cherry-pick:
|
||||
if: |
|
||||
github.event_name == 'pull_request' ||
|
||||
startsWith(github.base_ref, 'release-') ||
|
||||
(startsWith(github.base_ref, 'staging-') && github.base_ref != 'staging-next')
|
||||
fromJSON(inputs.baseBranch).stable
|
||||
permissions:
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-24.04-arm
|
||||
|
||||
Reference in New Issue
Block a user