diff --git a/action.yml b/action.yml index 7528bc4..c8f48e3 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/src/index.ts b/src/index.ts index 665c041..c84bec6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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}`);