Describe the bug
When both a timeout and retry_on_exit_code are specified, timeouts are not retried.
- name: "Example"
uses: nick-fields/retry@v3
with:
max_attempts: 2
retry_on: any
timeout_minutes: 10
retry_on_exit_code: 2
command: <COMMAND>
Expected behavior
If retry_on is set to any (timeout + error), and timeout_minutes and retry_on_exit_code have valid values specified, then both timeouts and specific exit codes should support retrying.
Implementation details
In the code, it looks like this happens because retry_on_exit_code is evaluated without considering whether the command has finished running. It could be that fixing this issue is as simple as checking that the command has finished executing before evaluating exit codes.
|
} else if (done && inputs.retry_on_exit_code && inputs.retry_on_exit_code !== exit) { |

Describe the bug
When both a
timeoutandretry_on_exit_codeare specified, timeouts are not retried.Expected behavior
If
retry_onis set toany(timeout + error), andtimeout_minutesandretry_on_exit_codehave valid values specified, then both timeouts and specific exit codes should support retrying.Implementation details
In the code, it looks like this happens because
retry_on_exit_codeis evaluated without considering whether the command has finished running. It could be that fixing this issue is as simple as checking that the command has finished executing before evaluating exit codes.retry/src/index.ts
Line 146 in 86d18a3