Skip to content

How to retry a failed step in github actions workflow? #27121

Answered by riprasad
riprasad asked this question in Actions
Discussion options

You must be logged in to vote

I was able to achieve retries by using this simple workaround

- name: Maven Deploy
  run: |
    # Retry 3 times before the steps actually fails
    (echo "===== Maven Deploy Attempt: 1 ====" && mvn deploy) || \
    (echo "===== Maven Deploy Attempt: 2 ====" && mvn deploy) || \
    (echo "===== Maven Deploy Attempt: 3 ====" && mvn deploy) || \
    (echo "==== Maven Deploy Step Failed ====" && exit 1)

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@knocte
Comment options

@webbertakken
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants