Does job status check functions in job-level "if" mean previous jobs?

Looking at docs

My question is, does this:

jobs:
  bar:
    steps: [...]
  foo:
    needs: ['bar']
    if: failure()

Mean foo only runs if bar failed?

Yes.

needs gates the start of the job to other jobs having finished, and if: failure() then checks for any failure in the results of these jobs.

1 Like