Can I force a job to be re-run under "Re-run failed" even if it succeeded? #121211
-
Select Topic AreaQuestion BodyOn our CI workflow, we have a setup steps that primes an ephemeral environment that our tests need to ping. This environment is configured to shutdown automatically after a few minutes of inactivity, to save costs. The problem we have is that, when choosing to "Re-run failed" on a failed workflow, this setup step is not re-run, since it was successful on the original run. But without re-running this setup, we cannot re-run the failed tests. Is there a way to specify in the workflow yml that a given step must always be run, even during a "re-run failed" if it was successful in the latest attempt? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
I think there are two different questions here:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply @mickeygousset, but I think I didn't make my original question clear. What we're looking for is, when re-running failed jobs only, whether it's possible to have a specific job to be re-run even if it succeeded originally. To give an example, let's say I have the following workflow: a set of parallel test jobs that depend on a setup job. graph TD;
setup --> test1;
setup --> test2;
setup --> test3;
setup --> test4;
Let's say in a given run all jobs succeeded except for Note that hitting "rerun all jobs" wouldn't do what we want, since it'd re-run |
Beta Was this translation helpful? Give feedback.
I agree, nothing really out of the box. Re-running the failed job would only re-run
test2
and any jobs that depend ontest2
.For something out of the box, you could add in some of
setup
's logic into thetest2
job that includes what thesetup
job is doing and only conditionally run it.And most re-use, you could create the steps of the
setup
job as a composite action so that all jobs share the same logic without having to duplicate a lot.There is also a debug variable you can tap into for this if you don't want to use
github.run_attempt
. When you re-run failed jobs, you could check the box to enable…