Skip to content

Commit 80b63a2

Browse files
authored
[CI] Only run one post commit job on a push to a pull request in sycl-devops-pr (#16079)
Kind of a really specific case, but if someone pushes to `sycl-devops-pr` to run postcommit and then makes a PR from the same branch, both the initial pull request event and every subsequent push to the branch will cause two postcommits to run, one from the push to the branch and one from the PR. Use a unique key that will be the same in both cases so only one is run and the other is cancelled. Nobody really uses this branch besides CI devs so we don't need to overengineer it so it never runs two in the first place IMO. --------- Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 0a3a324 commit 80b63a2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/sycl-post-commit.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ on:
2020
- ./devops/actions/cached_checkout
2121

2222
concurrency:
23-
# Cancel a currently running workflow from the same PR or commit hash.
24-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
23+
# Cancel a currently running workflow from the same PR or commit hash.
24+
# We need to use the user's branch name (which is in different variables
25+
# for pull request events and push events) so that making a PR from a
26+
# sycl-devops-pr branch doesn't cause two postcommit runs.
27+
group: "${{ github.actor }}-${{ github.head_ref || github.ref_name }}"
2528
cancel-in-progress: true
2629

2730
permissions: read-all

0 commit comments

Comments
 (0)