Skip to content

Jobs being skipped while using both needs and if. Unclear why. #26945

Answered by joequincy
joequincy asked this question in Actions
Discussion options

You must be logged in to vote

Through further experimentation, I discovered that I can set things up like

service_b:
    runs-on: ubuntu-latest
    needs: [gather_diffs, service_a]
    if: always() && (needs.gather_diffs.outputs.all || needs.gather_diffs.outputs.service_b)
    steps:
      - run: echo "service_b will deploy"

… which takes away the need to declare the if on every step of the job. This is a sufficient workaround, but even more so makes it feel like it’s a flaw in how Github Actions is processing the if conditional when a prior job has been skipped. I’m going to go ahead and report this as a bug.

Replies: 5 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@brianjmurrell
Comment options

@elijaholmos
Comment options

@brianjmurrell
Comment options

@elijaholmos
Comment options

@brianjmurrell
Comment options

Answer selected
Comment options

You must be logged in to vote
1 reply
@brianjmurrell
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants