jobs.<job_id>.if
not working?
#24802
-
I have created a workflow with jobs.<job_id>.if but it fails with:
Documentation says it should be possible. I created a small example at: https://github.com/reload/actions-test/pull/1/checks Edit August 14, 2019: jobs.<job_id>.if has been removed from the documentation now. See workaround below. Edit October 1, 2019: it’s back, working and documented! |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments
-
As a workaround I moved the if condition into each step in the job. There are some drawbacks to that though.
|
Beta Was this translation helpful? Give feedback.
-
I’m having the same issue, putting the
|
Beta Was this translation helpful? Give feedback.
-
I need also this feature, it works on steps but not at the job level. |
Beta Was this translation helpful? Give feedback.
-
A workaround 😦
|
Beta Was this translation helpful? Give feedback.
-
Nice workaround :slight_smile: I’ll try that. It’s probably better than |
Beta Was this translation helpful? Give feedback.
-
I have the same problem and have asked github support group for help. And I got their reply just now. It seems jobs doesn’t support if statement right now. And the online document is updated and jobs.<job_id>.if seems to be removed. |
Beta Was this translation helpful? Give feedback.
-
@rodrigonehrings workaround must the best we can do then… Thank you for sharing! |
Beta Was this translation helpful? Give feedback.
-
Ok, I tried the aproach now and it doesn’t give the result I was hoping for. Since this workaround will make the check job fail if the condition is met we end up with a failed job on i.e. a Pull Request. I wss aiming at something like neutral / skipped. So back to if on each step then … |
Beta Was this translation helpful? Give feedback.
-
I just tried this and it works as expected. I guess the feature is back but documentation is still missing. |
Beta Was this translation helpful? Give feedback.
-
Yes! I tried it as well and it worked! Now let’s hope it stays / gets documented. |
Beta Was this translation helpful? Give feedback.
-
One caveat / percularity: If you add jobs.<job_id>.if to all jobs of the workflow and none of them evalute to true none of the actions will be run (as expected) and the workflow/jobs will not show up on a pull request (also a expected). But if you go to the Actions tab you will see teh workflow running and appearing to run forever (doing nothing). |
Beta Was this translation helpful? Give feedback.
-
And with todays announcement (https://github.blog/changelog/2019-10-01-github-actions-new-workflow-syntax-features/) it is also documented again! |
Beta Was this translation helpful? Give feedback.
-
For some reasons the jobs dont even show up… Can you share your snippet? |
Beta Was this translation helpful? Give feedback.
I just tried this and it works as expected. I guess the feature is back but documentation is still missing.