Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,25 @@ jobs:
# Determine version from git tags (source of truth) + commit messages.
# The stamped package.json is committed back to master after publish so
# `--version` on a fresh source clone matches what's published on npm.
#
# Loop guard: if the latest commit on master IS the auto-generated
# release-bump-back commit, skip this run entirely. Otherwise the
# bump-PR's own merge would trigger another release, which would
# generate another bump-PR, in a perpetual chain.
- name: Determine version
id: version
run: |
# Loop guard — skip when the latest commit is the bot's
# auto-bump merge. Match the squash-merged form too:
# "chore(release): bump version to v2.0.3 (#274)".
LATEST_MSG=$(git log -1 --format="%s")
if echo "$LATEST_MSG" | grep -qE '^chore\(release\): bump version to v[0-9]+\.[0-9]+\.[0-9]+( \(#[0-9]+\))?$'; then
echo "Latest commit is the bot's auto-bump — skipping this release to avoid an infinite loop."
echo "Subject: $LATEST_MSG"
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi

# Get latest tag — this is the source of truth, NOT package.json
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
if [ -z "$LAST_TAG" ]; then
Expand Down
Loading