diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ed091f0..c837f42 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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