-
Notifications
You must be signed in to change notification settings - Fork 2.1k
ci: add breaking change detector #21499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
d128c07
968fc57
3500fee
b0f7cdf
dcb3cfc
8ec278a
e15d6a7
129e180
0a863bd
b3b6dde
95189de
97ee5b5
d5b1985
910501c
f40c07a
65779f4
6de3a14
1bd00c2
b3bf244
5286bab
10847a0
6d27da4
a903cae
83a2f39
8d99fba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| name: "Detect breaking changes" | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| check-semver: | ||
| name: Check semver | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| logs: ${{ steps.check_semver.outputs.logs }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - name: Install cargo-semver-checks | ||
| run: cargo install cargo-semver-checks | ||
|
|
||
| - name: Run cargo-semver-checks | ||
| id: check_semver | ||
| run: | | ||
| set +e | ||
| cargo semver-checks --baseline-rev origin/main 2>&1 | tee /tmp/semver-output.txt | ||
| EXIT_CODE=${PIPESTATUS[0]} | ||
| OUTPUT=$(sed 's/\x1b\[[0-9;]*m//g' /tmp/semver-output.txt) | ||
| echo "logs<<EOF" >> "$GITHUB_OUTPUT" | ||
| echo "$OUTPUT" >> "$GITHUB_OUTPUT" | ||
| echo "EOF" >> "$GITHUB_OUTPUT" | ||
| exit $EXIT_CODE | ||
|
|
||
| comment-on-pr: | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
| name: Comment on pull request | ||
| runs-on: ubuntu-latest | ||
| needs: check-semver | ||
| if: always() | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - name: Comment | ||
| if: ${{ needs.check-semver.result != 'success' }} | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought in general the ASF CI jobs are supposed to avoid using non github actions (unless it is on the whitelist) -- so I am surprised this works.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did not test the sticky pull request itself, just tested the breaking change detector |
||
| with: | ||
| header: pr-semver-check-error | ||
| message: | | ||
| Thank you for opening this pull request! | ||
|
|
||
| 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. | ||
|
|
||
| Details: | ||
|
|
||
| ``` | ||
| ${{ needs.check-semver.outputs.logs }} | ||
| ``` | ||
|
|
||
| - name: Delete comment | ||
| if: ${{ needs.check-semver.result == 'success' }} | ||
| uses: marocchino/sticky-pull-request-comment@v2 | ||
| with: | ||
| header: pr-semver-check-error | ||
| delete: true | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added to here so I can test it |
Uh oh!
There was an error while loading. Please reload this page.