Skip to content

Commit 8d9701b

Browse files
committed
Retry release creation on GitHub API errors
1 parent 8093fbb commit 8d9701b

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,20 @@ jobs:
5353
env:
5454
GH_TOKEN: ${{ github.token }}
5555
run: |
56-
gh release create "${{ steps.version.outputs.tag }}" \
57-
--repo "$GITHUB_REPOSITORY" \
58-
--target "$GITHUB_SHA" \
59-
--title "TPS ${{ steps.version.outputs.tag }}" \
60-
--generate-notes
56+
for attempt in 1 2 3; do
57+
if gh release create "${{ steps.version.outputs.tag }}" \
58+
--repo "$GITHUB_REPOSITORY" \
59+
--target "$GITHUB_SHA" \
60+
--title "TPS ${{ steps.version.outputs.tag }}" \
61+
--generate-notes; then
62+
exit 0
63+
fi
64+
65+
if [ "$attempt" -eq 3 ]; then
66+
echo "Failed to create GitHub release after $attempt attempts."
67+
exit 1
68+
fi
69+
70+
echo "Release creation failed on attempt $attempt. Retrying..."
71+
sleep 5
72+
done

0 commit comments

Comments
 (0)