Skip to content

Commit aa45797

Browse files
MichaelRyomMichaelRyom
authored andcommitted
🔧 Fix race condition in automated release workflow
- Add retry logic with pull/rebase for push conflicts - Handle up to 3 retry attempts with backoff - Graceful fallback on rebase conflicts - Should resolve the push failure from previous run
1 parent 615304e commit aa45797

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

‎.github/workflows/automated-release.yml‎

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,4 +428,35 @@ jobs:
428428
429429
Built from commit: ${{ github.sha }}"
430430
431-
git push origin Main
431+
# Retry push with pull if needed (handle race conditions)
432+
for i in {1..3}; do
433+
if git push origin Main; then
434+
echo "Successfully pushed on attempt $i"
435+
break
436+
else
437+
echo "Push failed on attempt $i, trying to pull and rebase..."
438+
if [ $i -lt 3 ]; then
439+
git pull --rebase origin Main
440+
# Check if rebase was successful
441+
if [ $? -ne 0 ]; then
442+
echo "Rebase failed, aborting and retrying from scratch"
443+
git rebase --abort
444+
git reset --hard HEAD~1
445+
git pull origin Main
446+
git add releases/
447+
git commit -m "🚀 Release v$VERSION - Add build artifacts for all platforms
448+
449+
- Windows x64 package: releases/v$VERSION/windows/
450+
- Linux x64 package: releases/v$VERSION/linux/
451+
- macOS x64 package: releases/v$VERSION/macos/
452+
- Updated latest symlink to point to v$VERSION
453+
454+
Built from commit: ${{ github.sha }}"
455+
fi
456+
sleep 5
457+
else
458+
echo "Failed to push after 3 attempts"
459+
exit 1
460+
fi
461+
fi
462+
done

0 commit comments

Comments
 (0)