mirror of
https://github.com/nick-fields/retry.git
synced 2026-02-12 08:05:29 +00:00
feat: add warning_on_retry input
This commit is contained in:
@@ -13,6 +13,7 @@ const COMMAND = getInput('command', { required: true });
|
||||
const RETRY_WAIT_SECONDS = getInputNumber('retry_wait_seconds', false) || 10;
|
||||
const POLLING_INTERVAL_SECONDS = getInputNumber('polling_interval_seconds', false) || 1;
|
||||
const RETRY_ON = getInput('retry_on') || 'any';
|
||||
const WARNING_ON_RETRY = getInput('warning_on_retry').toLowerCase() === 'true';
|
||||
|
||||
const OUTPUT_TOTAL_ATTEMPTS_KEY = 'total_attempts';
|
||||
const OUTPUT_EXIT_CODE_KEY = 'exit_code';
|
||||
@@ -130,7 +131,11 @@ async function runAction() {
|
||||
// error: error
|
||||
throw error;
|
||||
} else {
|
||||
warning(`Attempt ${attempt} failed. Reason: ${error.message}`);
|
||||
if (WARNING_ON_RETRY) {
|
||||
warning(`Attempt ${attempt} failed. Reason: ${error.message}`);
|
||||
} else {
|
||||
info(`Attempt ${attempt} failed. Reason: ${error.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user