Skip to content

Commit 900012a

Browse files
joaoh82claude
andauthored
release.yml: accept GitHub squash-merge (#N) suffix in detect regex (#19)
GitHub's default squash-merge title is `<PR title> (#N)` — so merging a Release PR titled `release: v0.1.2` lands on main as `release: v0.1.2 (#18)`, which the old anchored regex rejected. The v0.1.2 canary had to be kicked via workflow_dispatch as a result. Strip the trailing ` (#N)` before the regex test so both forms match. Editing the title to drop the suffix still works; it just isn't required anymore. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e321737 commit 900012a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ jobs:
6363
exit 0
6464
fi
6565
66-
MSG=$(git log -1 --pretty=%s)
66+
# GitHub's default squash-merge title is `<PR title> (#N)` —
67+
# e.g. `release: v0.1.2 (#18)`. Strip the trailing ` (#N)` so
68+
# the regex matches both the squash-merge form and the
69+
# stripped-title form (we still recommend editing to the
70+
# latter, but should-just-work beats should-remember).
71+
MSG=$(git log -1 --pretty=%s | sed -E 's/ \(#[0-9]+\)$//')
6772
if [[ "$MSG" =~ ^release:\ v([0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?)$ ]]; then
6873
VERSION="${BASH_REMATCH[1]}"
6974
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

0 commit comments

Comments
 (0)