mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
workflows/check: run "checks" in one workflow
This introduces "check" as another category of jobs suitable for the "Require status checks to pass" feature. Checks as a category would include everything that is done before even looking at the code: Right branch? Commit messages? Cherry-picked correctly? (commit messages are not checked, yet)
This commit is contained in:
@@ -1,29 +1,45 @@
|
||||
name: "Check cherry-picks"
|
||||
name: Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/check-cherry-picks.yml
|
||||
- .github/workflows/check.yml
|
||||
pull_request_target:
|
||||
branches:
|
||||
- 'release-**'
|
||||
- 'staging-**'
|
||||
- '!staging-next'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
permissions: {}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: cherry-pick-check
|
||||
no-channel-base:
|
||||
name: no channel base
|
||||
if: |
|
||||
startsWith(github.base_ref, 'nixos-') ||
|
||||
startsWith(github.base_ref, 'nixpkgs-')
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- run: |
|
||||
cat <<EOF
|
||||
The nixos-* and nixpkgs-* branches are pushed to by the channel
|
||||
release script and should not be merged into directly.
|
||||
|
||||
Please target the equivalent release-* branch or master instead.
|
||||
EOF
|
||||
exit 1
|
||||
|
||||
cherry-pick:
|
||||
if: |
|
||||
github.event_name == 'pull_request' ||
|
||||
startsWith(github.base_ref, 'release-') ||
|
||||
(startsWith(github.base_ref, 'staging-') && github.base_ref != 'staging-next')
|
||||
permissions:
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
30
.github/workflows/no-channel.yml
vendored
30
.github/workflows/no-channel.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: "No channel PR"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/no-channel.yml
|
||||
pull_request_target:
|
||||
|
||||
permissions: {}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
fail:
|
||||
if: |
|
||||
startsWith(github.event.pull_request.base.ref, 'nixos-') ||
|
||||
startsWith(github.event.pull_request.base.ref, 'nixpkgs-')
|
||||
name: "This PR is targeting a channel branch"
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- run: |
|
||||
cat <<EOF
|
||||
The nixos-* and nixpkgs-* branches are pushed to by the channel
|
||||
release script and should not be merged into directly.
|
||||
|
||||
Please target the equivalent release-* branch or master instead.
|
||||
EOF
|
||||
exit 1
|
||||
Reference in New Issue
Block a user