fix(ci): delete local tags before creating nightly release (#218)

The nightly workflow fails when re-running on the same day because
after deleting the remote tag, the local tag still exists in the
runner's checkout. GitHub CLI sees this local tag and expects it
to be pushed to remote.

This fix adds 'git tag -d' to delete local tags in both the
cleanup and create release steps, ensuring clean state before
creating new releases.
This commit is contained in:
Jatin K Malik
2026-02-16 20:52:09 -08:00
committed by GitHub
parent 74f9536ff9
commit b4e59b453d
+2
View File
@@ -100,6 +100,7 @@ jobs:
echo "Deleting old nightly release: $tag (created: $(date -d @$RELEASE_DATE -u +"%Y-%m-%d %H:%M:%S UTC"))"
gh release delete "$tag" --yes --repo ${{ github.repository }} 2>/dev/null || true
git push origin :refs/tags/"$tag" 2>/dev/null || true
git tag -d "$tag" 2>/dev/null || true
else
echo "Keeping nightly release: $tag (created: $(date -d @$RELEASE_DATE -u +"%Y-%m-%d %H:%M:%S UTC"))"
fi
@@ -210,6 +211,7 @@ jobs:
# If a release for today already exists, delete it first
gh release delete "$RELEASE_TAG" --yes --repo ${{ github.repository }} 2>/dev/null || true
git push origin :refs/tags/"$RELEASE_TAG" 2>/dev/null || true
git tag -d "$RELEASE_TAG" 2>/dev/null || true
gh release create "$RELEASE_TAG" \
--title "Nightly Build - ${{ steps.version.outputs.version }}" \