action icon indicating copy to clipboard operation
action copied to clipboard

Use `if: success() || failure()` instead of `if: always()`?

Open sschuberth opened this issue 1 year ago • 3 comments

Just wondering about your opinion @ethomson: Should the docs suggest to use if: success() || failure() instead of if: always() to prevent the summary to be created if the workflow is cancelled?

sschuberth avatar Jun 27 '24 12:06 sschuberth

GitHub documentation even recommends the use of if: ${{ !cancelled() }}.

kevin-belellou avatar Jan 04 '25 14:01 kevin-belellou

Sorry I missed this when it was opened; I would say that it depends. In my workflows, they would never complete nor produce test results that could be uploaded if they were cancelled. So the success or failure option makes sense for my workflows.

If there's a utility in documenting the cancelled case then I'm happy to do so. I'd love an explanation on when to use which, so if you have a concrete use case for a cancelled workflow that produces a test result then that would be helpful to include. 🙏

ethomson avatar Jan 04 '25 18:01 ethomson

Oh oops, I realize now that I parsed this precisely backwards. Thanks for the explanation.

ethomson avatar Jan 04 '25 18:01 ethomson