Skip to content

Can I force a job to be re-run under "Re-run failed" even if it succeeded? #121211

Discussion options

You must be logged in to vote

I agree, nothing really out of the box. Re-running the failed job would only re-run test2 and any jobs that depend on test2.

For something out of the box, you could add in some of setup's logic into the test2 job that includes what the setup 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.

- name: setup
  if: ${{ github.run_attempt > 1 }}
  uses: ./setup-action

# test2 stuff...

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…

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@mickeygousset
Comment options

@joshjohanning
Comment options

Answer selected by spalladino
@spalladino
Comment options

@spalladino
Comment options

@mickeygousset
Comment options

@spalladino
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Actions Build, test, and automate your deployment pipeline with world-class CI/CD Question
3 participants