Skip to content

Commit ffb20c6

Browse files
committed
[GHA] better handle canceling old builds.
1 parent fb4d2b0 commit ffb20c6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ on:
55
- master
66
pull_request:
77

8+
concurrency:
9+
# We use the pull request number to ensure that each PR has a unique concurrency group. This prevents different PRs from interfering
10+
# with each other, especially when multiple PRs originate from the same branch. If the pull request number is not available, we fall
11+
# back to using the branch name (`github.head_ref`) or the full reference (`github.ref`), ensuring uniqueness.
12+
#
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
816
jobs:
917
ci:
1018
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)