Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retry GitHub Action

Retry another GitHub Action when it fails. The target action receives the same inputs on each attempt, and the retry action returns the outputs from the first successful attempt.

Inputs

Input Required Default Description
uses Yes Action reference or path, for example actions/setup-node@v7.0.0.
with No {} YAML string containing the target action's inputs.
retries No 3 Number of times to retry the target action if it fails.

Outputs

Output Description
outputs The target action's outputs in JSON format.

Usage

- name: Checkout with retry
  id: checkout
  uses: enosix/ghac-retry@v1.0.0
  with:
    uses: actions/checkout@v7.0.1
    retries: 3

Pass target-action inputs as a YAML string through with - make sure to use the | character to preserve the formatting:

- name: Setup Node with retry
  uses: enosix/ghac-retry@v1.0.0
  with:
    uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
    with: |
      node-version: 24
      cache: npm
    retries: 2

Expressions in the target inputs are supported:

- name: Run action with retry
  uses: enosix/ghac-retry@v1.0.0
  with:
    uses: example/action@v1
    with: |
      token: ${{ secrets.GITHUB_TOKEN }}
      version: ${{ github.ref_name }}
    retries: 3

The generated wrapper runs attempts sequentially and only starts the next attempt when the previous attempt fails. If every attempt fails, the final failure is returned. The temporary wrapper is removed after the action runs, including when the target action fails.

About

Retry an action multiple times

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages