From 7f05dc1515aa46aa279cee92b99ffb9c68f5c144 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Mon, 21 Oct 2024 10:02:42 -0700 Subject: [PATCH] Prevent concurrent workflow runs on the same PR The previous concurrency key mostly did this, but did not consider that the PR's ref changes when a pull request is merged. In practice, this meant that closing/merging the PR shortly shortly after updating it would trigger two workflow runs. Only the latest run (cleanup) should continue. --- .github/workflows/preview_on_downstream_repo.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview_on_downstream_repo.yaml b/.github/workflows/preview_on_downstream_repo.yaml index 91e4712a1..e57dbd2c5 100644 --- a/.github/workflows/preview_on_downstream_repo.yaml +++ b/.github/workflows/preview_on_downstream_repo.yaml @@ -13,9 +13,9 @@ on: required: true type: boolean -# Cancel any in-progress runs of a caller workflow on the same branch. +# Cancel any in-progress runs of a caller workflow on the same pull request. concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.event.number }} cancel-in-progress: true env: