@@ -27,23 +27,25 @@ tasks:
2727
2828 echo "ℹ️ INFO: Tags - Full: $FULL | Minor: $MINOR | Major: $MAJOR"
2929
30- # Full tag: create and push only if absent on remote
30+ # Full tag: must NOT exist on remote; fail fast if it does
3131 full_remote_sha="$(remote_tag_sha "$FULL")"
32- if [ -z "$full_remote_sha" ]; then
33- if git rev-parse -q --verify "refs/tags/$FULL" >/dev/null 2>&1; then
34- echo "ℹ️ INFO: Full tag '$FULL' exists locally but not on remote; pushing"
35- else
36- echo "ℹ️ INFO: Creating full tag '$FULL'"
37- git tag -a "$FULL" -m "$FULL"
38- fi
39- git push "$REMOTE" "refs/tags/$FULL"
40- echo "✅ OK: Pushed full tag '$FULL'"
32+ if [ -n "$full_remote_sha" ]; then
33+ echo "❌ ERROR: Full tag '$FULL' already exists on remote; aborting" >&2
34+ exit 1
35+ fi
36+
37+ # Create full tag locally (if missing) and push
38+ if git rev-parse --quiet --verify "refs/tags/$FULL" >/dev/null 2>&1; then
39+ echo "ℹ️ INFO: Full tag '$FULL' exists locally but not on remote; pushing"
4140 else
42- echo "ℹ️ INFO: Full tag '$FULL' already exists on remote; skipping"
41+ echo "ℹ️ INFO: Creating full tag '$FULL'"
42+ git tag --annotate "$FULL" --message "$FULL"
4343 fi
44+ git push "$REMOTE" "refs/tags/$FULL"
45+ echo "✅ OK: Pushed full tag '$FULL'"
4446
4547 # Minor tag: create or update
46- git tag -f -a "$MINOR" -m "$FULL"
48+ git tag --force --annotate "$MINOR" --message "$FULL"
4749 minor_local_sha="$(tag_sha "$MINOR")"
4850 minor_remote_sha="$(remote_tag_sha "$MINOR")"
4951 if [ -z "$minor_remote_sha" ]; then
5961 fi
6062
6163 # Major tag: create or update
62- git tag -f -a "$MAJOR" -m "$FULL"
64+ git tag --force --annotate "$MAJOR" --message "$FULL"
6365 major_local_sha="$(tag_sha "$MAJOR")"
6466 major_remote_sha="$(remote_tag_sha "$MAJOR")"
6567 if [ -z "$major_remote_sha" ]; then
0 commit comments