chore(ci): use !cancelled() instead of always() for final job#460
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 SummaryReplaces Confidence Score: 5/5Safe to merge — minimal, correct one-line fix with no functional regressions on normal CI paths. The change is a single condition swap on a non-critical aggregator job. Both success and failure cases are handled identically to before; only cancelled workflows behave differently (correctly skipping the job). No logic, data, or security concerns. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[New commit pushed] --> B{cancel-in-progress}
B -- "supersedes previous run" --> C[Previous workflow cancelled]
B -- "no active run" --> D[Jobs run normally]
C --> E{final job condition}
D --> F[Jobs complete\nsuccess / failure / skipped]
F --> G{final job condition}
E -- "always() (old)" --> H[final runs anyway\nwastes runner, confusing annotations]
E -- "!cancelled() (new)" --> I[final skipped ✓]
G -- "!cancelled() (new)" --> J{Any failure/skipped/cancelled?}
J -- yes --> K[exit 1 — CI fails ✓]
J -- no --> L[exit 0 — CI passes ✓]
Reviews (1): Last reviewed commit: "chore(ci): use !cancelled() instead of a..." | 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 CI-only change that just adjusts when the
finaljob runs; main risk is slightly different status reporting when runs are cancelled.Overview
Updates the GitHub Actions
finalaggregator job to useif: ${{ !cancelled() }}instead ofalways(), so it still runs for upstream success/failure but does not run for cancelled workflows (e.g., superseded runs undercancel-in-progress).Adds clarifying comments to document why cancellation should skip the aggregator to avoid wasting runners and producing noise on cancelled commits.
Reviewed by Cursor Bugbot for commit 4c62d5f. Bugbot is set up for automated code reviews on this repo. Configure here.