Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 8

Trigger step if any previous step fails?

Solved! Go to Solution.

Is there a way to trigger a step if any of the previous ones failed, not only the previous one?

I could add this "if: failure()" step after each other step, but it would be overloaded...

 

I'd like to have this feature please.

7 Replies
Highlighted
GitHub Staff
Message 2 of 8

Re: Trigger step if any previous step fails?

If: failure() should run regardless of which step failed the given job.

Highlighted
Copilot Lvl 3
Message 3 of 8

Re: Trigger step if any previous step fails?

It is not the case, the scheduled CI of yesterday at midnight in all my repos configured with scheduled CI failed at "Setup Node.js" step and the last step "Notify Discord" of the workflow didn't fired. I triggered again the run and it passed, but apparently I can't find the log of the failed version, so I cannot show you...

 

I'll write here if it happens again (this time I won't re-trigger so the log of the failed run will not be overridden), but indeed

if: failure()

generally runs regardless of which step failed. I guess it was an exception/bug.

 

In case you can investigate, here are the runs.

Highlighted
GitHub Partner
Message 4 of 8

Re: Trigger step if any previous step fails?

Hi @inwardmovement ,

 

Thanks for your clarification! This should be an temporary issue which caused by backend services/images update, the ci services exit accidently including the latter steps even you monitor the failure. 

 

Thanks.

Highlighted
Copilot Lvl 3
Message 5 of 8

Re: Trigger step if any previous step fails?

Ok thanks for the information!

Highlighted
Copilot Lvl 3
Message 6 of 8

Re: Trigger step if any previous step fails?

@weide-zhou @chrispat so there it is again, it was ok on push yesterday but fails today on scheduled: log 

Any idea? Is it a problem with the actions themselves or with GitHub's "CI engine"?

Highlighted
Copilot Lvl 3
Message 7 of 8

Re: Trigger step if any previous step fails?

Nevermind, I will switch to email notifications for CI failures as notifications depending on workflow actions are not reliable enough in a pro context (and this is not depending on GitHub but on actions developers I guess).

Highlighted
Solution
GitHub Partner
Message 8 of 8

Re: Trigger step if any previous step fails?

Hi @inwardmovement ,

 

It's caused by the action itself.  The 'netlify/open-api' has released v0.13.0 just 21hours ago, and it's incompatible with node 10, that's why the error occurs. Now a new release v0.13.1 has been created, and removed 'engines.node'. Please try again for your workflow.

You can refer to the release here for more info.

 

Thanks.