ci: actually capture exit code to pass on to label artifact
What changed, and why it matters
This is a small GitHub Actions workflow fix. It corrects how the exit code from a semver compatibility check script is captured and passed to later steps. There is no security issue here—just a CI plumbing bug being fixed.
No security action needed. This is a routine CI maintenance change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit changes .github/workflows/semver-checks.yml. Previously the workflow relied on steps.semver.exit_code, which is not a valid GitHub Actions context path for a step’s exit code. The patch removes continue-on-error: true, runs the script with set +e so the step doesn’t immediately fail, explicitly captures $? into GITHUB_OUTPUT, and updates downstream references to use steps.semver.outputs.exit_code. This is a correctness fix for CI artifact labeling and conditional failure logic.
Changed components
.github/workflows/semver-checks.ymlInspect captured patch +6 / −4
diff --git a/.github/workflows/semver-checks.yml b/.github/workflows/semver-checks.yml
index 187484a5..9e77147b 100644
--- a/.github/workflows/semver-checks.yml
+++ b/.github/workflows/semver-checks.yml
@@ -33,12 +33,14 @@ jobs:
run: cargo binstall cargo-semver-checks@$(cat ./.github/workflows/cargo-semver-checks-version) --no-confirm
- name: "Run semver checks"
id: semver
- continue-on-error: true
- run: ./contrib/check-semver.sh ${{ github.event.pull_request.base.sha || github.event.before }}
+ run: |
+ set +e
+ ./contrib/check-semver.sh ${{ github.event.pull_request.base.sha || github.event.before }}
+ echo "exit_code=$?" >> $GITHUB_OUTPUT
- name: "Save breaking state"
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
- EXIT_CODE: ${{ steps.semver.exit_code }}
+ EXIT_CODE: ${{ steps.semver.outputs.exit_code }}
run: |
echo "$PR_NUMBER" > semver-break
echo "$EXIT_CODE" >> semver-break
@@ -48,5 +50,5 @@ jobs:
name: semver-break
path: semver-break
- name: "Fail on breaks to stable packages"
- if: ${{ steps.semver.exit_code == 1 }}
+ if: ${{ steps.semver.outputs.exit_code == 1 }}
run: exit 1
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.