add args for retries

Signed-off-by: Fedor Dikarev <fedor.dikarev@gmail.com>
This commit is contained in:
Fedor Dikarev 2025-01-23 02:27:56 +01:00
parent 327cd5a69d
commit 2bc89718bc
5 changed files with 25 additions and 5 deletions

View file

@ -507,6 +507,9 @@ The following inputs can be used as `step.with` keys:
| `password` | String | | Password or personal access token for authenticating the Docker registry |
| `ecr` | String | `auto` | Specifies whether the given registry is ECR (`auto`, `true` or `false`) |
| `logout` | Bool | `true` | Log out from the Docker registry at the end of a job |
| `http_errors_to_retry` | String | `408,500,502,504` | Comma separated list of HTTP error codes we want to retry |
| `max_attempts` | String | `1` | Overall maximum number of attempts we will make trying to login (1 means no retries) |
| `retry_timeout` | String | `15` | Timeout between retries, in seconds |
## Contributing

View file

@ -24,6 +24,17 @@ inputs:
description: 'Log out from the Docker registry at the end of a job'
default: 'true'
required: false
http_errors_to_retry:
description: 'Comma separated list of HTTP error codes we want to retry'
default: '408,500,502,504'
max_attempts:
description: 'Overall maximum number of attempts we will make trying to login'
default: '1'
required: false
retry_timeout:
description: 'Timeout between retries, in seconds'
default: '15'
required: false
runs:
using: 'node20'

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -6,6 +6,9 @@ export interface Inputs {
password: string;
ecr: string;
logout: boolean;
http_errors_to_retry: string[];
max_attempts: number;
retry_timeout: number;
}
export function getInputs(): Inputs {
@ -14,6 +17,9 @@ export function getInputs(): Inputs {
username: core.getInput('username'),
password: core.getInput('password'),
ecr: core.getInput('ecr'),
logout: core.getBooleanInput('logout')
logout: core.getBooleanInput('logout'),
http_errors_to_retry: core.getInput('http_errors_to_retry').split(','),
max_attempts: Number.parseInt(core.getInput('max_attempts')),
retry_timeout: Number.parseInt(core.getInput('retry_timeout'))
};
}