Skip to content

Commit 591efbf

Browse files
committed
fix(release): don't release when the push adds the pin
When #3 lands on main, the commit before the push has no mise.toml, so the pin looked changed to v0.1.7. A missing earlier pin now means no release. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent 4668a3a commit 591efbf

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎scripts/release/tag-release.sh‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
# Reads the pin, OPENSHELL_CORE_REF in mise.toml, at <commit> (default:
99
# $GITHUB_SHA, else HEAD). A pre-release pin creates nothing. Without --force,
1010
# nothing is created either when the pin at <commit> equals the pin at --since
11-
# (default: the parent of <commit>), so ordinary pushes to main are no-ops.
11+
# (default: the parent of <commit>) or there is no pin there, so ordinary
12+
# pushes to main and the push that adds mise.toml are no-ops.
1213
# The release workflow passes the commit before the push as --since, which
1314
# covers pushes of several commits. Then, each step only when missing:
1415
# - tag vX.Y.Z (lightweight) at <commit>; a tag at another commit fails
@@ -52,10 +53,16 @@ if [ "$force" -eq 0 ]; then
5253
if [ -z "$since" ] || ! git rev-parse --verify --quiet "$since^{commit}" >/dev/null; then
5354
since="$sha^"
5455
fi
55-
if [ "$(pin_at "$since" || true)" = "$pin" ]; then
56+
old=$(pin_at "$since" || true)
57+
if [ "$old" = "$pin" ]; then
5658
echo "The pin is $pin both at $short and at $(git rev-parse --short "$since"); no SDK release." >&2
5759
exit 0
5860
fi
61+
# No pin before means the push added mise.toml (the import), not a bump.
62+
if [ -z "$old" ]; then
63+
echo "No pin at $(git rev-parse --short "$since"); no SDK release." >&2
64+
exit 0
65+
fi
5966
fi
6067

6168
# get_or_empty <api path> <jq>: the value, empty on 404, and fail on any other

0 commit comments

Comments
 (0)