How to rerun a docker container on failure in GitHub Actions, but still have the workflow pass? How to rerun a docker container on failure in GitHub Actions, but still have the workflow pass? docker docker

How to rerun a docker container on failure in GitHub Actions, but still have the workflow pass?


It looks like Lei Yang's answer was mostly correct, but needed the addition of using if: steps.first_attempt.outcome != 'success' rather than if: always()

 jobs:   run_tests:     steps:       - name: Run Test       id: first-attempt       run: docker run test       continue-on-error: true       - name: Retry again on failure       id: second-attempt       if: steps.first_attempt.outcome != 'success'       run: docker run test

Thank you for the help