Skip to content

Semantics of using "job.needs" and "job.if" together #25286

Answered by weide-zhou
hiranya911 asked this question in Actions
Discussion options

You must be logged in to vote

Hi @hiranya911 ,

Job2 will be executed until job1 finished. As doc mentioned, if job1 failed, job2 will be skipped.

The exception is, if you set ‘if: always()’ in job2, job2 will be executed even job1 failed. Please refer to the official doc for more details.

job2:
    runs-on: [ubuntu-latest]
    if: always()
    needs: job1

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants