Skip to content

chore(ci): use !cancelled() instead of always() for final job#496

Merged
jdx merged 1 commit intomainfrom
ci/cancelled-fix
May 3, 2026
Merged

chore(ci): use !cancelled() instead of always() for final job#496
jdx merged 1 commit intomainfrom
ci/cancelled-fix

Conversation

@jdx
Copy link
Copy Markdown
Contributor

@jdx jdx commented May 3, 2026

Summary

  • Combined with the workflow's cancel-in-progress group, if: always() overrides cancellation and runs the final aggregator 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.
  • Caught by Cursor Bugbot on a sibling repo (chore(ci): add final aggregator job for branch protection pitchfork#413). Same final-aggregator pattern + cancel-in-progress: true here, so the same fix applies.

Test plan

  • CI passes on this PR
  • Push a follow-up commit to verify the prior workflow run gets cancelled cleanly (final no longer spinning up on superseded commits)

🤖 Generated with Claude Code


Note

Low Risk
Low risk workflow-only change that just prevents the final aggregator job from running on cancelled CI runs; it may affect required status reporting only in cancellation scenarios.

Overview
Updates the CI workflow’s final aggregator job to run with if: ${{ !cancelled() }} instead of always(), so it still gates upstream success/failure but does not start when a run is cancelled (e.g., by cancel-in-progress). This avoids consuming runners and emitting status annotations on superseded commits.

Reviewed by Cursor Bugbot for commit 7ae7997. Bugbot is set up for automated code reviews on this repo. Configure here.

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]>
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 3, 2026

Greptile Summary

Fixes the final aggregator job's if condition from always() to !cancelled(). This ensures the job skips when a workflow run is superseded and cancelled by the cancel-in-progress: true group setting, while still correctly running (and gating) when upstream jobs succeed or fail normally.

Confidence Score: 5/5

Safe to merge — a single, well-understood CI behavioural fix with no code changes.

The change is minimal and correct: !cancelled() is the canonical GitHub Actions pattern for aggregator/gate jobs that must also respect cancel-in-progress. The added inline comment clearly explains the reasoning. No logic or application code is affected.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Replaces always() with !cancelled() on the final aggregator job, so the job correctly skips when the workflow is cancelled by cancel-in-progress while still running on upstream success or failure.

Reviews (1): Last reviewed commit: "chore(ci): use !cancelled() instead of a..." | Re-trigger Greptile

@jdx jdx merged commit 35c994c into main May 3, 2026
20 checks passed
@jdx jdx deleted the ci/cancelled-fix branch May 3, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant