chore(ci): use !cancelled() instead of always() for final job#70
Conversation
Combined with the workflow's `cancel-in-progress` group, `if: always()` overrides cancellation and runs the aggregator even on superseded commits. `!cancelled()` still runs on upstream success or failure but skips when the workflow is cancelled. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
Greptile SummaryThis PR replaces Confidence Score: 5/5Safe to merge — minimal, well-motivated change with no impact on build/test logic. Single-line change to a CI condition with a clear explanation. The No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[New push triggers workflow] --> B{cancel-in-progress}
B -- "supersedes previous run" --> C[Previous run cancelled]
C --> D{final job condition}
D -- "always() — OLD" --> E[final runs anyway\nwastes runner, noisy annotation]
D -- "!cancelled() — NEW" --> F[final skipped\nclean cancellation]
B -- "no superseding push" --> G[test + msrv jobs run]
G --> H{all success?}
H -- yes --> I[final runs — exits 0]
H -- no --> J[final runs — exits 1\nmarks PR red]
Reviews (2): Last reviewed commit: "Merge branch 'main' into ci/cancelled-fi..." | Re-trigger Greptile |
Summary
cancel-in-progressgroup,if: always()overrides cancellation and runs thefinalaggregator even on superseded commits.!cancelled()still runs on upstream success or failure but skips when the workflow is cancelled — saves a runner and avoids confusing error annotations on already-superseded shas.final-aggregator pattern +cancel-in-progress: truehere, so the same fix applies.Test plan
🤖 Generated with Claude Code
Note
Low Risk
Low risk: only adjusts a GitHub Actions
ifcondition so thefinalaggregator job doesn’t run on cancelled/superseded workflows, reducing wasted runners and noisy failures.Overview
Updates the CI workflow so the
finalaggregator job runs for upstream success/failure but skips when the workflow is cancelled by replacingif: always()withif: ${{ !cancelled() }}.This prevents
cancel-in-progresssuperseded runs from still executingfinaland emitting misleading failure annotations.Reviewed by Cursor Bugbot for commit 6b74546. Bugbot is set up for automated code reviews on this repo. Configure here.