icebear0828 commited on
Commit
968fdb7
·
1 Parent(s): 5ebcb56

fix: add retry with rebase to bump workflow on push conflict

Browse files

The bump workflow failed when concurrent workflows (e.g. changelog sync)
pushed to master between checkout and push, causing a ref lock conflict.
Now retries up to 3 times with pull --rebase.

Files changed (1) hide show
  1. .github/workflows/bump-electron.yml +14 -2
.github/workflows/bump-electron.yml CHANGED
@@ -78,6 +78,18 @@ jobs:
78
  git add package.json packages/electron/package.json
79
  git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
80
  git tag -a "$NEW_TAG" -m "Release ${NEW_TAG}"
81
- git push origin master --follow-tags
82
 
83
- echo "Bumped to $NEW_VERSION, tagged $NEW_TAG"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  git add package.json packages/electron/package.json
79
  git commit -m "chore: bump version to ${NEW_VERSION} [skip ci]"
80
  git tag -a "$NEW_TAG" -m "Release ${NEW_TAG}"
 
81
 
82
+ # Retry push with rebase on conflict (other workflows may push concurrently)
83
+ for i in 1 2 3; do
84
+ if git push origin master --follow-tags; then
85
+ echo "Bumped to $NEW_VERSION, tagged $NEW_TAG"
86
+ exit 0
87
+ fi
88
+ echo "Push failed (attempt $i/3), rebasing and retrying..."
89
+ git tag -d "$NEW_TAG"
90
+ git pull --rebase origin master
91
+ git tag -a "$NEW_TAG" -m "Release ${NEW_TAG}"
92
+ sleep 2
93
+ done
94
+ echo "::error::Push failed after 3 attempts"
95
+ exit 1