Skip to content

Commit d128c07

Browse files
committed
ci: add breaking change detector
1 parent e1ad871 commit d128c07

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Detect breaking changes"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check-semver:
10+
name: Check semver
11+
runs-on: ubuntu-latest
12+
outputs:
13+
logs: ${{ steps.check_semver.outputs.logs }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Run cargo-semver-checks
19+
id: check_semver
20+
# Fork https://github.com/obi1kenobi/cargo-semver-checks-action/pull/65
21+
uses: orhun/cargo-semver-checks-action@cc19b888f2062f8cc964c1d52f7f29d910becb31
22+
23+
comment-on-pr:
24+
name: Comment on pull request
25+
runs-on: ubuntu-latest
26+
needs: check-semver
27+
if: always()
28+
permissions:
29+
pull-requests: write
30+
steps:
31+
- name: Comment
32+
if: ${{ needs.check-semver.result != 'success' }}
33+
uses: marocchino/sticky-pull-request-comment@v2
34+
with:
35+
header: pr-semver-check-error
36+
message: |
37+
Thank you for opening this pull request!
38+
39+
Reviewer note: [cargo-semver-checks](https://github.com/obi1kenobi/cargo-semver-checks) reported the current version number is not SemVer-compatible with the changes made since the last release.
40+
41+
Details:
42+
43+
```
44+
${{ needs.check-semver.outputs.logs }}
45+
```
46+
47+
- name: Delete comment
48+
if: ${{ needs.check-semver.result == 'success' }}
49+
uses: marocchino/sticky-pull-request-comment@v2
50+
with:
51+
header: pr-semver-check-error
52+
delete: true

0 commit comments

Comments
 (0)