Skip to content

Commit

Permalink
Prevent concurrent workflow runs on the same PR
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
victorlin committed Oct 21, 2024
1 parent 40beaf0 commit 7f05dc1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/preview_on_downstream_repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7f05dc1

Please sign in to comment.