Skip to content

Commit 1dc3836

Browse files
Copilotrajbos
andcommitted
Add concurrency controls to prevent concurrent workflow runs on same branch
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent 004ca4e commit 1dc3836

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/deploy-to-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ permissions:
1616
pages: write
1717
id-token: write
1818

19-
# Allow only one concurrent deployment
19+
# Allow only one concurrent deployment per branch
2020
concurrency:
21-
group: "pages"
21+
group: "pages-${{ github.head_ref || github.ref }}"
2222
cancel-in-progress: true
2323

2424
jobs:

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
branches:
66
- main
77

8+
# Allow only one concurrent deployment per branch
9+
concurrency:
10+
group: "deploy-${{ github.ref }}"
11+
cancel-in-progress: true
12+
813
permissions:
914
contents: write
1015

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
release:
55
types: [created]
66

7+
# Allow only one concurrent release build
8+
concurrency:
9+
group: "publish-${{ github.ref }}"
10+
cancel-in-progress: true
11+
712
jobs:
813
build-and-publish:
914
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)