Skip to content

Commit 9498d0a

Browse files
authored
Prevent release PR collisions (#4448)
1 parent c9613af commit 9498d0a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/upsert-release-pr.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
# - Readme generation was optimized a bit
1414
# - We only installed the changeset package
1515

16+
# Prevent race condition in writing to the changeset branch.
17+
concurrency:
18+
group: deploy-and-release
19+
cancel-in-progress: false
20+
1621
jobs:
1722
consume-changesets:
1823
name: Upsert Release PR
@@ -27,6 +32,13 @@ jobs:
2732
UPSTREAM_BRANCH: 'HEAD~1'
2833
SELECTED_ADAPTERS: ${{ inputs.selected-adapters }}
2934
steps:
35+
- name: Check if changeset release branch already exists
36+
shell: bash
37+
run: |
38+
if git ls-remote --exit-code "https://github.com/${GITHUB_REPOSITORY}.git" changeset-release/main; then
39+
echo "Branch already exists: changeset-release/main"
40+
exit 1
41+
fi
3042
- name: Checkout Repo
3143
uses: actions/checkout@v4
3244
with:

0 commit comments

Comments
 (0)