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

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

Open
sschuberth opened this issue Jun 27, 2024 · 3 comments
Open

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

sschuberth opened this issue Jun 27, 2024 · 3 comments

Comments

@sschuberth
Copy link

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?

@kevin-belellou
Copy link

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

@ethomson
Copy link
Member

ethomson commented Jan 4, 2025

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
Copy link
Member

ethomson commented Jan 4, 2025

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

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

No branches or pull requests

3 participants