Retries an Github Action step or command on failure.
Works with either shell commands or other actions to retry.
Github actions which use an Internet connection can fail when connection is lost :
Run actions/setup-node@v1
connect ETIMEDOUT 104.20.22.46:443
Waiting 15 seconds before trying again
connect ETIMEDOUT 104.20.22.46:443
Waiting 18 seconds before trying again
Error: connect ETIMEDOUT 104.20.22.46:443
It is a cause of failed jobs. For this case, the action wretry.action
can retry the action immediately after fail or with some delay. And if the connection will be restored, then the job will continue the normal run.
- Retries Github actions. The action can be an action repository that is not published on
Marketplace
. - Retries shell command.
- Can retry single action or single command ( multiline command ), but not both simultaneously.
- Retries only
main
,pre
andpost
stages of external actions. - Always has
pre
andpost
stages. If external action haspre
or/andpost
stage, then action run it also. - Handles no conditions in external actions. All stages of external action will be performed.
- Retries actions with defined number of attempts ( default is 2 ).
- Retries actions with defined delay between attempts ( default is 0 ).
- Resolves external action default inputs from next contexts :
github
,env
,job
.
The name of the Github action.
The command to run.
Attend. Action requires defined action
or command
. If the fields action
and commands
are defined simultaneously, then action will throw error.
An options map for Github action. It is a multiline string with pairs key : value
.
Setup working directory for the action. Works with only commands. Default is github.workspace
path.
Set number of attempts. Default is 2.
Set delay between attempts in ms. Default is 0.
Depends on output of given Github action.
uses: Wandalen/wretry.action@v1.0.11
with:
action: action/node-setup@2.3.0
with: |
node-version: 14.x
architecture: x64
attempt_limit: 3
attempt_delay: 2000
uses: Wandalen/wretry.action@v1.0.11
with:
command: npm i
attempt_limit: 3
attempt_delay: 2000
To build compiled dependencies utility willbe
is required. To install utility run :
npm i -g 'willbe@latest'
willbe
is not required to use the action in your project as submodule.