Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ inputs:
required: false
default: 1
retry_on:
description: Event to retry on. Currently supported [any, timeout, error]
description: Event to retry on. Currently supported [any, timeout, error, success]
warning_on_retry:
description: Whether to output a warning on retry, or just output to info. Defaults to true
default: true
Expand Down
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,11 @@ async function runAction(inputs: Inputs) {
setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
await runCmd(attempt, inputs);
info(`Command completed after ${attempt} attempt(s).`);
break;
// eslint-disable-next-line
if (inputs.retry_on !== 'success') {
break;
// eslint-disable-next-line
}
await retryWait(ms.seconds(inputs.retry_wait_seconds));
} catch (error: any) {
if (attempt === inputs.max_attempts) {
throw new Error(`Final attempt failed. ${error.message}`);
Expand Down