Skip to content

Commit d23240d

Browse files
eregonclaude
andcommitted
Fix race between jobs creating the release
Multiple jobs can see no release and try to create it concurrently, and the losers failed with HTTP 422. Check again if the release exists when creating it fails. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
1 parent c00272b commit d23240d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ jobs:
120120
GH_TOKEN: ${{ github.token }}
121121
GH_REPO: ${{ github.repository }}
122122
run: |
123-
gh release view "${{ steps.ruby.outputs.tag }}" || gh release create "${{ steps.ruby.outputs.tag }}" --notes "Builds of ${{ steps.ruby.outputs.ruby }}"
123+
# Jobs race to create the release, so if creating fails check whether another job created it meanwhile
124+
gh release view "${{ steps.ruby.outputs.tag }}" || gh release create "${{ steps.ruby.outputs.tag }}" --notes "Builds of ${{ steps.ruby.outputs.ruby }}" || gh release view "${{ steps.ruby.outputs.tag }}"
124125
gh release upload "${{ steps.ruby.outputs.tag }}" "${{ steps.ruby.outputs.archive }}"
125126
126127
buildJRubyWindows:
@@ -209,7 +210,8 @@ jobs:
209210
GH_TOKEN: ${{ github.token }}
210211
GH_REPO: ${{ github.repository }}
211212
run: |
212-
gh release view "${{ steps.ruby.outputs.tag }}" || gh release create "${{ steps.ruby.outputs.tag }}" --notes "Builds of ${{ steps.ruby.outputs.ruby }}"
213+
# Jobs race to create the release, so if creating fails check whether another job created it meanwhile
214+
gh release view "${{ steps.ruby.outputs.tag }}" || gh release create "${{ steps.ruby.outputs.tag }}" --notes "Builds of ${{ steps.ruby.outputs.ruby }}" || gh release view "${{ steps.ruby.outputs.tag }}"
213215
gh release upload "${{ steps.ruby.outputs.tag }}" "${{ steps.ruby.outputs.archive }}"
214216
215217

0 commit comments

Comments
 (0)