IssueRaiser

Jobs skipped when NEEDS job ran successfully

<!-- πŸ‘‹ You're opening a bug report against the GitHub Actions **runner application**. πŸ›‘ Please stop if you're not certain that the bug you're seeing is in the runner application - if you have general problems with actions, workflows, or runners, please see the [GitHub Community Support Forum](https://github.community/c/code-to-cloud/52) which is actively monitored. Using the forum ensures that we route your problem to the correct team. πŸ˜ƒ --> **Describe the bug** One or more jobs are skipped in a workflow when run after successfully running a job matching following conditions: - Job has NEEDS dependency on one or more preceding jobs. (i.e. needs: [job1, job2]) - Job has if condition specifying behavior when NEEDS jobs are skipped. (i.e. if: always() && needs.job1.result == 'skipped') - Preceding job is skipped (i.e. job1) **To Reproduce** Create a workflow as follows: ``` name: Skipped Job Test on: workflow_dispatch: jobs: Skipped-Job: name: skipped job runs-on: [self-hosted] if: 1 != 1 steps: - name: write to console 1 run: Write-Host "I should be skipped" Needs-Job: name: needs conditional job needs: Skipped-Job if: always() && needs.Skipped-Job.result != 'failed' # this should run eventhough needs the skipped-job runs-on: [self-hosted] steps: - name: write to console 2 run: Write-Host "Needs-Job completed" Next: name: Next job needs: Needs-Job # if: always() && needs.Needs-Job.re

Posted by niekvanderreest on Oct 14, 2022, 12:53 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.2,500 issues0 comments

support (Software)

Jobs skipped when NEEDS job ran successfully

niekvanderreestOct 14, 2022, 12:53 PM

<!-- πŸ‘‹ You're opening a bug report against the GitHub Actions **runner application**. πŸ›‘ Please stop if you're not certain that the bug you're seeing is in the runner application - if you have general problems with actions, workflows, or runners, please see the [GitHub Community Support Forum](https://github.community/c/code-to-cloud/52) which is actively monitored. Using the forum ensures that we route your problem to the correct team. πŸ˜ƒ --> **Describe the bug** One or more jobs are skipped in a workflow when run after successfully running a job matching following conditions: - Job has NEEDS dependency on one or more preceding jobs. (i.e. needs: [job1, job2]) - Job has if condition specifying behavior when NEEDS jobs are skipped. (i.e. if: always() && needs.job1.result == 'skipped') - Preceding job is skipped (i.e. job1) **To Reproduce** Create a workflow as follows: ``` name: Skipped Job Test on: workflow_dispatch: jobs: Skipped-Job: name: skipped job runs-on: [self-hosted] if: 1 != 1 steps: - name: write to console 1 run: Write-Host "I should be skipped" Needs-Job: name: needs conditional job needs: Skipped-Job if: always() && needs.Skipped-Job.result != 'failed' # this should run eventhough needs the skipped-job runs-on: [self-hosted] steps: - name: write to console 2 run: Write-Host "Needs-Job completed" Next: name: Next job needs: Needs-Job # if: always() && needs.Needs-Job.re

Comments (0)

No comments yet. Start the discussion.

Comment on this issue