Closed
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
https://docs.github.com/en/actions/learn-github-actions/expressions#failure
What part(s) of the article would you like to see updated?
The docs mention how to use failure()
to catch failing jobs and then goes on to say it's the same as job.status == 'failure'
or github.action_status == 'failure'
, however from my testing this isn't true.
Using either of the above fail to run after a failing job, e.g.
steps:
- name: Fail demo
run: exit 1
- name: The job has failed
if: ${{ job.status == 'failure' }}
The docs suggest The job has failed
is meant to run here, but from my testing it doesn't. Not sure if this is a bug with github actions or the docs are just wrong or if I'm just missing something.
I think these broken examples should be removed and a practical example showing how to catch a specific failing job rather than all jobs would be useful here.
Additional information
No response
Activity