Skip to content

Commit c03b46a

Browse files
wechuliSiaraMist
andauthored
Update always() function documentation with warning message and provide better alternative (github#38676)
Co-authored-by: Siara <108543037+SiaraMist@users.noreply.github.com>
1 parent 28d1211 commit c03b46a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/actions/learn-github-actions/expressions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,11 @@ steps:
339339

340340
Causes the step to always execute, and returns `true`, even when canceled. The `always` expression is best used at the step level or on tasks that you expect to run even when a job is canceled. For example, you can use `always` to send logs even when a job is canceled.
341341

342-
{% note %}
342+
{% warning %}
343343

344-
**Note:** 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: success() || failure()`
344+
**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: {% raw %}${{ !cancelled() }}{% endraw %}`
345345

346-
{% endnote %}
346+
{% endwarning %}
347347

348348
#### Example of `always`
349349

0 commit comments

Comments
 (0)