Skip to content
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

Replace github action always into !cancelled. #1440

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jaehwa-Noh
Copy link
Contributor

What I have done and why

Always is run even workflow had been cancelled.
documentation

To cancel the workflow run, the server re-evaluates if conditions for all currently running jobs. If the condition evaluates to true, the job will not get canceled. For example, the condition if: always() would evaluate to true and the job continues to run. When there is no condition, that is the equivalent of the condition if: success(), which only runs if the previous step finished successfully.

And GitHub action recommend use !cancelled rather than always.
documentation

Warning

Avoid using always for any task that could suffer from a critical failure, for example: getting sources, otherwise the workflow may hang until it times out. If you want to run a job or step regardless of its success or failure, use the recommended alternative: if: ${{ !cancelled() }}

And github action in here looked sufficient to use !cancelled.

Fix #1439

Change-Id: I6518ce38a6640d42b9089e264c529ddaf75766b8
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.

[Bug]: Github action some jobs can't cancel
1 participant