mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-12-06 07:34:11 +00:00
ci(release): retry the rolling tag push
After pushing the pin commit to main, GitHub rejected the immediate v1 tag force-push with "missing necessary objects", so the release run failed and the rolling tag stayed on the previous commit. Retry a few times before failing. Co-authored-by: Bug Fixer <[email protected]>
This commit is contained in:
@@ -68,5 +68,18 @@ jobs:
|
||||
# commit behind, pinning the PREVIOUS image.
|
||||
# "v1" must match the release job's rolling-release-tag input.
|
||||
git tag -f v1 HEAD
|
||||
git push -f origin refs/tags/v1
|
||||
# GitHub can reject the tag push for a moment after main was
|
||||
# updated ("missing necessary objects"), so retry before failing.
|
||||
pushed=false
|
||||
for _ in 1 2 3 4 5; do
|
||||
if git push -f origin refs/tags/v1; then
|
||||
pushed=true
|
||||
break
|
||||
fi
|
||||
sleep 5
|
||||
done
|
||||
if [ "$pushed" != true ]; then
|
||||
echo "::error::Could not move the v1 tag after 5 attempts."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user