File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3333permissions :
3434 contents : write
3535
36+ # Serialize releases so two pushes landing close together can't both read the same
37+ # latest tag and race to create it. cancel-in-progress: false queues the later run
38+ # (every push is a distinct release to cut) rather than cancelling the in-flight one.
39+ concurrency :
40+ group : release-main
41+ cancel-in-progress : false
42+
3643jobs :
3744 release :
3845 runs-on : ubuntu-latest
@@ -63,11 +70,21 @@ jobs:
6370 exit 0
6471 fi
6572
66- # Resolve the bump level from the (merge) commit message; default patch.
73+ # Resolve the bump level. Conventional Commits puts the <type>/<type>!: prefix on
74+ # the SUBJECT (first line); BREAKING CHANGE is an uppercase footer on its own line.
75+ # We match accordingly so prose can't force a bump — e.g. "docs: mention a breaking
76+ # change", or a squash-merge body that concatenates every PR bullet, no longer trips
77+ # a major. The [major]/[minor] tags remain deliberate escape hatches and may appear
78+ # anywhere in the message. Default is patch.
79+ SUBJECT="$(printf '%s' "$HEAD_COMMIT_MSG" | head -n1)"
80+
6781 LEVEL="patch"
68- if printf '%s' "$HEAD_COMMIT_MSG" | grep -qiE 'BREAKING CHANGE|\[major\]|(^|[^a-z])[a-z]+(\([^)]*\))?!:'; then
82+ if printf '%s' "$SUBJECT" | grep -qE '^[a-z]+(\([^)]*\))?!:' \
83+ || printf '%s' "$HEAD_COMMIT_MSG" | grep -qE '^BREAKING[ -]CHANGE:' \
84+ || printf '%s' "$HEAD_COMMIT_MSG" | grep -qiE '\[major\]'; then
6985 LEVEL="major"
70- elif printf '%s' "$HEAD_COMMIT_MSG" | grep -qiE '\[minor\]|(^|[^a-z])feat(\([^)]*\))?:'; then
86+ elif printf '%s' "$SUBJECT" | grep -qE '^feat(\([^)]*\))?:' \
87+ || printf '%s' "$HEAD_COMMIT_MSG" | grep -qiE '\[minor\]'; then
7188 LEVEL="minor"
7289 fi
7390 echo "Bump level resolved from commit message: ${LEVEL}"
You can’t perform that action at this time.
0 commit comments