Skip to content

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

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

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

Conversation

@jdx
Copy link
Copy Markdown
Owner

@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 endevco/pitchfork#413). Same final-aggregator pattern + cancel-in-progress: true here, so the same fix applies.

Test plan

  • CI passes on this PR

🤖 Generated with Claude Code


Note

Low Risk
Low risk CI-only change that adjusts when the final job runs; main impact is potentially skipping failure aggregation on cancelled/superseded runs.

Overview
Updates the GitHub Actions final aggregator in ci.yml to use if: ${{ !cancelled() }} instead of always(), so it still runs after upstream success/failure but does not run when the workflow is cancelled (e.g., due to cancel-in-progress). This avoids consuming runners and emitting misleading failure annotations on superseded commits.

Reviewed by Cursor Bugbot for commit 3b8b543. 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]>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 3, 2026

Greptile Summary

Replaces if: always() with if: ${{ !cancelled() }} on the final aggregator job in the CI workflow. Since the workflow already uses cancel-in-progress: true, always() was causing the aggregator to run even on cancelled (superseded) workflow runs, wasting a runner and generating confusing annotations — !cancelled() preserves the "run on success or failure" semantics while correctly respecting cancellation.

Confidence Score: 5/5

Safe to merge — correct, well-understood GitHub Actions best practice with no functional regressions.

Single-line CI config fix with no code logic changes; the semantics of !cancelled() vs always() are well-defined and the fix directly addresses the stated problem with cancel-in-progress.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/ci.yml Single-line change: if: always()if: ${{ !cancelled() }} on the final aggregator job; correct fix for the cancel-in-progress interaction.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[New commit pushed] --> B{cancel-in-progress}
    B -- "existing run active" --> C[Cancel previous workflow]
    B -- "no existing run" --> D[Run all CI jobs]
    C --> E{final job condition}
    D --> F[All jobs complete success/failure]
    F --> E
    E -- "always() ❌" --> G[final runs anyway\nwastes runner + noisy annotations]
    E -- "!cancelled() ✅" --> H{Was workflow cancelled?}
    H -- yes --> I[final skipped]
    H -- no --> J[final runs\nchecks all job results]
Loading

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

@jdx jdx merged commit 1317e8c into main May 3, 2026
22 checks passed
@jdx jdx deleted the ci/cancelled-fix branch May 3, 2026 15:28
@jdx jdx mentioned this pull request May 3, 2026
jdx added a commit that referenced this pull request May 5, 2026
### 🚀 Features

- **(builtins)** add `buildifier` format and lint built-ins by
[@plx](https://github.com/plx) in
[#896](#896)

### 🐛 Bug Fixes

- **(step)** only auto-batch when rendered command exceeds ARG_MAX by
[@jdx](https://github.com/jdx) in
[#901](#901)

### 📚 Documentation

- thank Namespace for GitHub Actions runner support by
[@jdx](https://github.com/jdx) in
[#895](#895)

### 🔍 Other Changes

- **(ci)** use !cancelled() instead of always() for final job by
[@jdx](https://github.com/jdx) in
[#906](#906)
- **(docs)** remove shrill.en.dev analytics script by
[@jdx](https://github.com/jdx) in
[#903](#903)
- remove rust-cache from release jobs by [@jdx](https://github.com/jdx)
in [#893](#893)
- invert CLAUDE.md/AGENTS.md so AGENTS.md is canonical by
[@jdx](https://github.com/jdx) in
[#905](#905)
- set dev profile debug to 1 by [@jdx](https://github.com/jdx) in
[#907](#907)

### 📦️ Dependency Updates

- update anthropics/claude-code-action digest to fefa07e by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#897](#897)
- update jdx/mise-action digest to 1648a78 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#898](#898)
- update apple-actions/import-codesign-certs action to v7 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#900](#900)
- update autofix-ci/action action to v1.3.4 by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#899](#899)
- lock file maintenance by
[@renovate[bot]](https://github.com/renovate[bot]) in
[#908](#908)

### New Contributors

- @plx made their first contribution in
[#896](#896)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release bookkeeping: primarily version string updates across
manifests and docs with no functional code changes in this diff.
> 
> **Overview**
> Updates the project for the `v1.45.0` release by bumping the crate/CLI
version (`Cargo.toml`, `Cargo.lock`, `hk.usage.kdl`, generated CLI docs)
and adding the `1.45.0` entry to `CHANGELOG.md`.
> 
> Refreshes documentation and example configs to reference the new
versioned Pkl package URLs (`docs/*.md`, `docs/public/*.pkl`,
`hk-example.pkl`).
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
cfe2da5. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: mise-en-dev <[email protected]>
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