fix: fail prepare when release tag already exists
Some checks failed
Push Validation / validate (push) Has been cancelled

Prevent silent successful runs that skip tag creation. If the resolved
release tag already exists locally or remotely, fail with guidance so users
know why tag-triggered do-release will not run.
This commit is contained in:
Micheal Wilkinson
2026-03-20 21:29:26 +00:00
parent e8e1dc9695
commit 63aa7376cc

View File

@@ -209,8 +209,9 @@ runs:
git remote set-url origin "$authed_remote" git remote set-url origin "$authed_remote"
if git rev-parse "$RELEASE_TAG" >/dev/null 2>&1 || git ls-remote --exit-code --tags origin "refs/tags/${RELEASE_TAG}" >/dev/null 2>&1; then if git rev-parse "$RELEASE_TAG" >/dev/null 2>&1 || git ls-remote --exit-code --tags origin "refs/tags/${RELEASE_TAG}" >/dev/null 2>&1; then
echo "Tag ${RELEASE_TAG} already exists; skipping commit/tag/push." echo "Tag ${RELEASE_TAG} already exists; no new tag can be pushed, so tag-triggered release publication will not run." >&2
exit 0 echo "Choose a new version (or update changelog content so recommendation advances) and run Prepare Release again." >&2
exit 1
fi fi
for f in $GIT_ADD_FILES; do for f in $GIT_ADD_FILES; do