|
Ran
|
Jobs
1
|
Files
95
|
Run time
1min
|
Badge
README BADGES
|
push
github
Merge rust-bitcoin/rust-bitcoin#3028: ci: fix semver-checks master 6ab8f9973 ci: fix semver-checks master (Jose Storopoli) Pull request description: Ok now I think I've nailed this! 🚀 Closes #3018. ## Summary This PR fix the permissions by adding a secondary job, `semver-checks-pr-label`, that runs only if the `semver-checks` completes and does not fail, i.e. we have either Semver API breaks. This is a secure job according to internal discussions and https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run ## Implementation notes We split the semver checks into the actual check and labeling. This is due to the fact that we were having several permission issues and the original implementation was insecure. Also it is currently failing on several PRs. 1. `semver-checks.yml`: checks for API semver breaks. Upon finding API semver-checks, it creates a file named `semver-break` that has the PR number inside. If this file is present we upload an artifact representing that the API semver was broken with the PR number. 2. `semver-checks-pr-label.yml`: runs after the `semver-checks.yml` is completed. It uses `actions/github-script` (in JavaScript) to list the previous workflow artifacts and, if finds that an API semver break is present, adds a corresponding label and a comment to the PR that is inside the file `semver-break`. We sanitize the hell out of the thing to be a number only, both in BASH but also in JavaScript. ## How I tested this? 1. I merged this PR to my `master` branch in my `storopoli/rust-bitcoin` repo. 2. I've set the following settings in the repo settings to mimic what we have for `rust-bitcoin`:  3. I've made a PR (cherry-picked from Toby) that breaks semver, see https://github.com/storopoli/rust-bitcoin/pull/10. It correctly labelled as `API bre... (continued)
19645 of 23611 relevant lines covered (83.2%)
15564.09 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 9963545476.1 | 0 |
83.2 |
GitHub Action Run |