android / nowinandroid

A fully functional Android app built entirely with Kotlin and Jetpack Compose
Apache License 2.0
16.62k stars 3.01k forks source link

Replace github action `always` into `!cancelled`. #1440

Open Jaehwa-Noh opened 4 months ago

Jaehwa-Noh commented 4 months ago

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