Skip to content

Commit b79e0d9

Browse files
authored
ci: honor breaking semver markers (#922)
1 parent 0a95c3b commit b79e0d9

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,22 @@ jobs:
8080
with:
8181
tool: cargo-semver-checks
8282

83+
- name: Determine semver release type
84+
run: |
85+
if git log --format=%B \
86+
${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} \
87+
| grep -Eq '(^[A-Za-z0-9_-]+(\([^)]*\))?!:|^BREAKING[ -]CHANGE:)'; then
88+
echo "SEMVER_RELEASE_TYPE=major" >> "$GITHUB_ENV"
89+
else
90+
echo "SEMVER_RELEASE_TYPE=minor" >> "$GITHUB_ENV"
91+
fi
92+
8393
- name: Check rmcp (default features)
8494
run: |
8595
cargo semver-checks \
8696
--package rmcp \
8797
--baseline-rev ${{ github.event.pull_request.base.sha }} \
88-
--release-type minor \
98+
--release-type "$SEMVER_RELEASE_TYPE" \
8999
--only-explicit-features \
90100
--features default
91101
@@ -98,7 +108,7 @@ jobs:
98108
cargo semver-checks \
99109
--package rmcp \
100110
--baseline-rev ${{ github.event.pull_request.base.sha }} \
101-
--release-type minor \
111+
--release-type "$SEMVER_RELEASE_TYPE" \
102112
--only-explicit-features \
103113
--features "$FEATURES"
104114

0 commit comments

Comments
 (0)