how to run job depending on other any job success?
See original GitHub issueI need to run current job based on previous jobs.Which means if I have 2jobs before current job , I need to run current job if any one job is triggered/success.
I tried needs
event by putting 2 jobs inside.but it is running current job only if 2 jobs got success. Basically I’m expecting or
functionality. Any solution?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
How to put conditional job in need of another job in Github ...
jobs : A: runs-on: ubuntu-latest steps: - run: echo "success ... work since it will always be success for this job regardless did...
Read more >How do i run a job based on success of another job?
The way I usually do that is to put the steps for the dependent jobs into the first job and set the "On...
Read more >The basics of CI: How to run jobs sequentially, in parallel, ...
Every job contains a set of rules and instructions for GitLab CI, defined by special keywords. Jobs can run sequentially, in parallel, or...
Read more >Conditions - Azure Pipelines
By default, a job or stage runs if it doesn't depend on any other job or stage, or if all of the jobs...
Read more >7 advanced workflow automation features with GitHub ...
GitHub Actions runs multiple commands at the same time by default—but you can leverage the needs keyword to create dependencies between jobs.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this example workflow. You can use
always()
to trigger a job regardless of other jobs failing. Then, in your job that has dependencies, you can set its run condition toif: ${{ always() && contains(join(needs.*.result, ','), 'success') }}
.Please note that if you ever add
continue-on-error: true
to the failing jobdep1
, it will set its result tosuccess
, soneeds.dep1.result
will always besuccess
, thus rendering the check injob
useless.Saved my day!