Skip to content

Commit be08d84

Browse files
committed
fix: don't re-trigger release, cater for some concurrency issues
1 parent e79b630 commit be08d84

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/semantic-release.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,23 @@ jobs:
1414
name: Release
1515
needs: [pre-commit, tests]
1616
runs-on: ubuntu-latest
17-
concurrency: release
17+
concurrency:
18+
group: ${{ github.workflow }}-release-${{ github.ref_name }}
19+
cancel-in-progress: false
1820
permissions:
1921
id-token: write
22+
contents: write
2023
steps:
2124
- name: Checkout
2225
uses: actions/checkout@v4
2326
with:
24-
#ssh-key: ${{ secrets.DEPLOY_KEY }}
2527
token: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
28+
ref: ${{ github.ref_name }}
2629
fetch-depth: 0
2730

31+
- name: Force release branch to workflow SHA
32+
run: git reset --hard ${{ github.sha }}
33+
2834
- name: Setup Python
2935
uses: actions/setup-python@v5
3036
with:
@@ -43,7 +49,8 @@ jobs:
4349
env:
4450
GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}
4551
run: |
46-
if semantic-release version; then
52+
output=$(semantic-release version)
53+
if [[ $output == *"The next version is"* ]]; then
4754
echo "released=true" >> $GITHUB_OUTPUT
4855
else
4956
echo "released=false" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)