Skip to content

Commit 89627f3

Browse files
committed
ci: fix cancelled jobs in CI merge queue
It is hard to find proper documentation for that and what fails here doesn't fail in other projects. In a GitHub merge queue, each job is created twice by default (as we have `on merge_group and on pull_request` in the CI file): - for the PR/push itself - for the merge queue Currently, sometime our merge queue fails because some of these jobs are cancelled: ``` Canceling since a higher priority waiting request for Build-refs/heads/gh-readonly-queue/main/pr-89-b4aed85cf70ae7e2df098e42c352c3dd62ef9173 exists ``` To prevent cancellation, I try to switch to more distinct concurrency groups. I didn't find proper documentation or best practices, but with some research, I came up with this solution. On-behalf-of: SAP philipp.schuster@sap.com Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
1 parent b4aed85 commit 89627f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ on:
66
push:
77

88
concurrency:
9-
group: ${{ github.workflow }}-${{ github.ref }}
10-
cancel-in-progress: true
9+
# Special care needs to be taken here to prevent cancelled runs in the GitHub
10+
# merge queue.
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
12+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1113

1214
jobs:
1315
checks:

0 commit comments

Comments
 (0)