Skip to content

Commit

Permalink
CI: cancel workflows when PRs are updated
Browse files Browse the repository at this point in the history
For zloop, zfs-qemu, and codeql workflows cancel in-progress jobs
when the PR is updated.  We always let the style checker run
since it only takes a few minutes to complete.

Relevant GitHub Actions documentation:

  The following concurrency group cancels in-progress jobs or run
  on pull_request events only; if github.head_ref is undefined, the
  concurrency group will fallback to the run ID, which is guaranteed
  to be both unique and defined for the run.

https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value
Signed-off-by: Brian Behlendorf <[email protected]>
Issue #16562
  • Loading branch information
behlendorf committed Sep 24, 2024
1 parent d40d409 commit d9f3d26
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/zfs-qemu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ on:
push:
pull_request:

jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
qemu-vm:
name: qemu-x86
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/zloop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
zloop:
runs-on: ubuntu-24.04
Expand Down

0 comments on commit d9f3d26

Please sign in to comment.