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.
| 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. |
| Output | Description |
|---|---|
outputs |
The target action's outputs in JSON format. |
- name: Checkout with retry
id: checkout
uses: enosix/ghac-retry@v1.0.0
with:
uses: actions/checkout@v7.0.1
retries: 3Pass 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: 2Expressions 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: 3The 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.