Skip to content
/ utils Public

Use cancelled() function instead of always()#684

Merged
5ouma merged 1 commit intomainfrom
refactor-pre-commit-actions-cancelled
Jan 30, 2026
Merged

Use cancelled() function instead of always()#684
5ouma merged 1 commit intomainfrom
refactor-pre-commit-actions-cancelled

Conversation

@5ouma
Copy link
Owner

@5ouma 5ouma commented Jan 30, 2026

It will not perform when cancelled by users or when a timeout occurs.

It will not perform when canclled by users or timeout.
Copilot AI review requested due to automatic review settings January 30, 2026 13:52
@github-actions github-actions bot added the 🚸 pre-commit Check the code with pre-commit hooks label Jan 30, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GitHub Actions workflow so that certain cleanup and reporting steps are skipped when a workflow run is cancelled (by user action or timeout), while still running on failures.

Changes:

  • Replace always() with !cancelled() for the "Clean up unused hooks" step so it only runs when the job is not cancelled.
  • Replace always() && steps.hooks.outputs.downloaded == 'true' with !cancelled() && steps.hooks.outputs.downloaded == 'true' for the "Remove downloaded hooks" step.
  • Replace always() with !cancelled() for the "Run pre-commit-ci-lite" step to avoid running it on cancelled jobs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

Walkthrough

A GitHub Actions workflow configuration file is modified to use !cancelled() instead of always() for step execution conditions. This change prevents three cleanup and execution steps from running when the workflow is cancelled.

Changes

Cohort / File(s) Summary
Workflow Step Conditions
pre-commit/action.yml
Replaced always() with !cancelled() in three steps ("Clean up unused hooks", "Remove downloaded hooks", "Run pre-commit-ci-lite") to gate execution on cancellation status.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing always() with cancelled() in the GitHub Actions workflow file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The PR description accurately describes the changeset, stating the action will not run when cancelled or on timeout.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor-pre-commit-actions-cancelled

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@5ouma 5ouma merged commit 80ff828 into main Jan 30, 2026
11 checks passed
@5ouma 5ouma deleted the refactor-pre-commit-actions-cancelled branch January 30, 2026 13:56
@5ouma 5ouma bot mentioned this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚸 pre-commit Check the code with pre-commit hooks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants