Skip to content

Commit 51042c1

Browse files
Prot10claude
andcommitted
fix: add pre-flight check for existing GitHub release
Prevents signature mismatch by failing early if a release already exists. Provides instructions for how to delete and re-release if needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent fff3e7c commit 51042c1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/release.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,19 @@ if [ -z "$VERSION" ]; then
8282
exit 1
8383
fi
8484

85+
# Check if release already exists on GitHub
86+
if gh release view "v${VERSION}" --repo "${REPO}" &>/dev/null; then
87+
echo -e "${RED}Error: Release v${VERSION} already exists on GitHub${NC}"
88+
echo ""
89+
echo "To re-release this version, first delete the existing release:"
90+
echo " gh release delete v${VERSION} --repo ${REPO} --yes"
91+
echo " git tag -d v${VERSION}"
92+
echo " git push origin --delete v${VERSION}"
93+
echo ""
94+
echo "Then run this script again."
95+
exit 1
96+
fi
97+
8598
# Read changelog from CHANGELOG.md [Unreleased] section
8699
if [ -f "$CHANGELOG_FILE" ]; then
87100
# Extract lines between [Unreleased] and the next ## header

0 commit comments

Comments
 (0)