From 61cbc36164170865a50a186dd175d840dbce296c Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 13 Nov 2024 12:42:11 -0800 Subject: [PATCH 1/2] [CI] Only run one post commit job on a push to a pull request in sycl-devops-pr Signed-off-by: Sarnie, Nick --- .github/workflows/sycl-post-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sycl-post-commit.yml b/.github/workflows/sycl-post-commit.yml index 1abd497a9c97c..1f9fc0448c0ee 100644 --- a/.github/workflows/sycl-post-commit.yml +++ b/.github/workflows/sycl-post-commit.yml @@ -21,7 +21,7 @@ on: concurrency: # Cancel a currently running workflow from the same PR or commit hash. - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + group: "${{ github.actor }}-${{ github.head_ref || github.ref_name }}" cancel-in-progress: true permissions: read-all From 0441dcdf8a2f9c34572f53a70393dd90d44d1e69 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 13 Nov 2024 13:07:50 -0800 Subject: [PATCH 2/2] add comment Signed-off-by: Sarnie, Nick --- .github/workflows/sycl-post-commit.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sycl-post-commit.yml b/.github/workflows/sycl-post-commit.yml index 1f9fc0448c0ee..15c66c8d4bdfa 100644 --- a/.github/workflows/sycl-post-commit.yml +++ b/.github/workflows/sycl-post-commit.yml @@ -20,7 +20,10 @@ on: - ./devops/actions/cached_checkout concurrency: - # Cancel a currently running workflow from the same PR or commit hash. + # Cancel a currently running workflow from the same PR or commit hash. + # We need to use the user's branch name (which is in different variables + # for pull request events and push events) so that making a PR from a + # sycl-devops-pr branch doesn't cause two postcommit runs. group: "${{ github.actor }}-${{ github.head_ref || github.ref_name }}" cancel-in-progress: true