retry icon indicating copy to clipboard operation
retry copied to clipboard

Feature Request: retry another github action

Open jduan-highnote opened this issue 1 year ago • 4 comments

Is it possible to retry another github action? For example, if my workflow uses the following to install a JDK:

      - name: Retry Set up JDK if failed
        uses: actions/setup-java@v4
        with:
          distribution: 'zulu'
          java-version: 21

Is it possible to use this action to retry it?

My current workaround is this:

      - name: Set up JDK
        id: setup_jdk
        uses: actions/setup-java@v4
        with:
          distribution: 'zulu'
          java-version: 21
      - name: Sleep a bit
        run: sleep 5
      - name: Retry Set up JDK if failed
        if: steps.setup_jdk.outcome == 'failure'
        uses: actions/setup-java@v4
        with:
          distribution: 'zulu'
          java-version: 21

which is not elegant.

jduan-highnote avatar Jul 01 '24 18:07 jduan-highnote

I'm not sure there is a (reliable) way to load an action via another action, so I can't do anything about it here.

nick-fields avatar Jul 01 '24 19:07 nick-fields

Thanks for the quick response! Do you have a better workaround than mine? Thanks!

jduan-highnote avatar Jul 01 '24 19:07 jduan-highnote

@jduan-highnote I think you can use this: https://github.com/Wandalen/wretry.action

shayki5 avatar Jul 04 '24 12:07 shayki5

@shayki5 thank you for sharing! I'll check it out.

jduan-highnote avatar Jul 04 '24 15:07 jduan-highnote