-
Notifications
You must be signed in to change notification settings - Fork 14
GitHub Actions: Evaluate to replace always() by '!cancelled()'
#4963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Co-authored-by: mfranzke <787658+mfranzke@users.noreply.github.com>
There was a problem hiding this 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 replaces all instances of always() with !cancelled() in GitHub Actions workflows to prevent jobs from running when builds are manually cancelled while still allowing them to run when previous steps fail.
Key changes:
- Updated conditional logic in workflow files to use
!cancelled()instead ofalways() - Applied consistent GitHub expression syntax with
${{ }}wrappers - Maintained existing functionality for failure handling while respecting manual cancellations
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/workflows/release.yml |
Updated checks-done job condition to use !cancelled() |
.github/workflows/default.yml |
Updated 5 job conditions including regenerate-snapshots jobs and checks-done |
.github/workflows/02-e2e-regenerate.yml |
Updated 4 upload artifact step conditions to use !cancelled() |
always() by '!cancelled()'always() by '!cancelled()'
|
I am not sure if we can simply replace always() with !cancelled().
If we combine both
it ensures that the job runs on failure (e.g. snapshots are regenerated), but skips on manual cancellation. |
@michaelmkraus My understanding is that |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@michaelmkraus looks good to me in running https://github.com/db-ux-design-system/core-web/pull/4963/checks?sha=92bd8c9814c3735b3dba647f07f90a687c96e2f4 Does this answer your question ? |
Replace
always()with!cancelled()in GitHub Actions workflows to prevent jobs from running when builds are manually cancelled.Plan:
always()usage in GitHub workflow filesalways()with!cancelled()in02-e2e-regenerate.yml(4 instances)always()with!cancelled()inrelease.yml(1 instance)always()with!cancelled()indefault.yml(5 instances)Files modified:
.github/workflows/02-e2e-regenerate.yml- 4 upload artifact steps.github/workflows/release.yml- 1 checks-done job.github/workflows/default.yml- 3 regenerate-snapshots jobs, 1 multiline condition, 1 checks-done jobChanges made:
always()with!cancelled()across 3 workflow files${{ !cancelled() && condition }}syntax for GitHub expressionsRationale:
Using
!cancelled()instead ofalways()ensures jobs don't run when builds are manually cancelled, while still running when previous steps fail. This improves the user experience by respecting manual cancellations.Fixes #4673.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.