kebab-case for action inputs, fix README, fix comments in retry tests

Signed-off-by: Fedor Dikarev <fedor.dikarev@gmail.com>
This commit is contained in:
Fedor Dikarev 2025-01-23 16:51:59 +01:00
parent fdf655e1ab
commit c4d11d0a1e
4 changed files with 17 additions and 14 deletions

View file

@ -500,16 +500,16 @@ jobs:
The following inputs can be used as `step.with` keys:
| Name | Type | Default | Description |
|------------|--------|---------|-------------------------------------------------------------------------------|
| `registry` | String | | Server address of Docker registry. If not set then will default to Docker Hub |
| `username` | String | | Username for authenticating to the Docker registry |
| `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_codes_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 |
| Name | Type | Default | Description |
|-----------------------|--------|---------|-------------------------------------------------------------------------------|
| `registry` | String | | Server address of Docker registry. If not set then will default to Docker Hub |
| `username` | String | | Username for authenticating to the Docker registry |
| `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-codes-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 could make (`1` means no retries) |
| `retry-timeout` | String | `15` | Timeout between retries, in seconds |
## Contributing

View file

@ -9,7 +9,8 @@ test('login retries function', async () => {
let stderr_strings: string[] = [];
let call_count: number = -1;
// const execSpy = jest.spyOn(Docker, 'getExecOutput').mockImplementation(async () => {
// using spyOn() here isn't enough, as we alter the logic
// so use `jest.fn()` here for the `Docker.getExecOutput`
Docker.getExecOutput = jest.fn(async () => {
call_count++;
console.log(`Mock: ${call_count}, ${stderr_strings}`);

View file

@ -7,6 +7,8 @@ test('login retries success function', async () => {
let stderr_strings: string[] = [];
let call_count: number = -1;
// using spyOn() here isn't enough, as we alter the logic
// so use `jest.fn()` here for the `Docker.getExecOutput`
Docker.getExecOutput = jest.fn(async () => {
call_count++;
console.log(`Mock: ${call_count}, ${stderr_strings}`);

View file

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