Compare commits

...

3 Commits

Author SHA1 Message Date
Raja Anbazhagan
c97818ca39 fix: group log lines for each attempt (#146) 2025-02-17 12:26:57 -05:00
Róbert Papp
dfb235ae84 Fix local action reference (#140) 2024-09-18 15:49:01 +00:00
Brandon Williams
3f757583fb docs: update README.md with new version (#130) 2024-02-03 13:24:21 +00:00
2 changed files with 14 additions and 11 deletions

View File

@@ -79,7 +79,7 @@ The final error returned by the command
### Shell ### Shell
```yaml ```yaml
uses: nick-fields/retry@v2 uses: nick-fields/retry@v3
with: with:
timeout_minutes: 10 timeout_minutes: 10
max_attempts: 3 max_attempts: 3
@@ -90,7 +90,7 @@ with:
### Timeout in minutes ### Timeout in minutes
```yaml ```yaml
uses: nick-fields/retry@v2 uses: nick-fields/retry@v3
with: with:
timeout_minutes: 10 timeout_minutes: 10
max_attempts: 3 max_attempts: 3
@@ -100,7 +100,7 @@ with:
### Timeout in seconds ### Timeout in seconds
```yaml ```yaml
uses: nick-fields/retry@v2 uses: nick-fields/retry@v3
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -110,7 +110,7 @@ with:
### Only retry after timeout ### Only retry after timeout
```yaml ```yaml
uses: nick-fields/retry@v2 uses: nick-fields/retry@v3
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -121,7 +121,7 @@ with:
### Only retry after error ### Only retry after error
```yaml ```yaml
uses: nick-fields/retry@v2 uses: nick-fields/retry@v3
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -132,7 +132,7 @@ with:
### Retry using continue_on_error input (in composite action) but allow failure and do something with output ### Retry using continue_on_error input (in composite action) but allow failure and do something with output
```yaml ```yaml
- uses: nick-fields/retry@v2 - uses: nick-fields/retry@v3
id: retry id: retry
with: with:
timeout_seconds: 15 timeout_seconds: 15
@@ -154,7 +154,7 @@ with:
### Retry using continue-on-error built-in command (in workflow action) but allow failure and do something with output ### Retry using continue-on-error built-in command (in workflow action) but allow failure and do something with output
```yaml ```yaml
- uses: nick-fields/retry@v2 - uses: nick-fields/retry@v3
id: retry id: retry
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error # see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error
continue-on-error: true continue-on-error: true
@@ -183,7 +183,7 @@ with:
### Run script after failure but before retry ### Run script after failure but before retry
```yaml ```yaml
uses: nick-fields/retry@v2 uses: nick-fields/retry@v3
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -194,7 +194,7 @@ with:
### Run different command after first failure ### Run different command after first failure
```yaml ```yaml
uses: nick-fields/retry@v2 uses: nick-fields/retry@v3
with: with:
timeout_seconds: 15 timeout_seconds: 15
max_attempts: 3 max_attempts: 3
@@ -206,7 +206,7 @@ with:
```yaml ```yaml
name: Multi-line multi-command Test name: Multi-line multi-command Test
uses: ./ uses: nick-fields/retry@v3
with: with:
timeout_minutes: 1 timeout_minutes: 1
max_attempts: 2 max_attempts: 2
@@ -219,7 +219,7 @@ with:
```yaml ```yaml
name: Multi-line single-command Test name: Multi-line single-command Test
uses: ./ uses: nick-fields/retry@v3
with: with:
timeout_minutes: 1 timeout_minutes: 1
max_attempts: 2 max_attempts: 2

View File

@@ -130,6 +130,7 @@ async function runAction(inputs: Inputs) {
await validateInputs(inputs); await validateInputs(inputs);
for (let attempt = 1; attempt <= inputs.max_attempts; attempt++) { for (let attempt = 1; attempt <= inputs.max_attempts; attempt++) {
info(`::group::Attempt ${attempt}`);
try { try {
// just keep overwriting attempts output // just keep overwriting attempts output
setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt); setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
@@ -156,6 +157,8 @@ async function runAction(inputs: Inputs) {
info(`Attempt ${attempt} failed. Reason: ${error.message}`); info(`Attempt ${attempt} failed. Reason: ${error.message}`);
} }
} }
} finally {
info(`::endgroup::`);
} }
} }
} }