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:
@@ -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 }}" \
|
||||
|
||||
Reference in New Issue
Block a user