https://github.com/klothoplatform/gh-action-retry
Simple retry loop for GitHub actions
https://github.com/klothoplatform/gh-action-retry
Last synced: 3 months ago
JSON representation
Simple retry loop for GitHub actions
- Host: GitHub
- URL: https://github.com/klothoplatform/gh-action-retry
- Owner: klothoplatform
- License: apache-2.0
- Created: 2022-12-14T15:33:30.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-19T00:07:39.000Z (over 3 years ago)
- Last Synced: 2025-03-05T19:34:58.140Z (over 1 year ago)
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gh-action-retry
A simple retry loop for bash in GitHub actions.
## Usage tl;dr
```yaml
uses: klothoplatform/gh-action-retry@v1
with:
script: |
echo "Some script that may intermittently fail. For example:"
exit "$(( $(date +%s) % 3 ))" # exit with a random code from 0 to 2
```
## Options
| name | required? | default | description |
|---------------------|-----------|-----------------|-------------------------------------------------------------------------|
| `script` | yes | | the bash script to run |
| `max-attempts` | no | 5 | how many attempts before the step exits out with failure |
| `sleep-seconds` | no | 0 | how many seconds to wait between attempts |
| `description` | no | "Script" | used to identify the step in the GitHub error, if all the attempts fail |
| `working-directory` | no | `.` | working directory for the script |
| `bash-options` | no | `-euo pipefail` | `set` options to use while executing the script ⚠️ |
⚠️ : bash-options are not sanitized, so if you provide this input, use a hard-coded value or a highly-trusted source.
(Needless to say, the same applies for the script itself.)