2 Commits

Author SHA1 Message Date
CrazyMax
508c654904 chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-11 14:38:22 +02:00
CrazyMax
38e5bc6168 multiple logins support
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-11 14:38:22 +02:00
3 changed files with 34 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ ___
* [OCI Oracle Cloud Infrastructure Registry (OCIR)](#oci-oracle-cloud-infrastructure-registry-ocir) * [OCI Oracle Cloud Infrastructure Registry (OCIR)](#oci-oracle-cloud-infrastructure-registry-ocir)
* [Quay.io](#quayio) * [Quay.io](#quayio)
* [DigitalOcean](#digitalocean-container-registry) * [DigitalOcean](#digitalocean-container-registry)
* [Authenticate to multiple registries](#authenticate-to-multiple-registries)
* [Customizing](#customizing) * [Customizing](#customizing)
* [inputs](#inputs) * [inputs](#inputs)
* [Contributing](#contributing) * [Contributing](#contributing)
@@ -494,6 +495,35 @@ jobs:
password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
``` ```
### Authenticate to multiple registries
You can authenticate to multiple registries by using the `logins` input. Define
the registries as YAML objects. Each object can contain `registry`, `username`,
`password` and `ecr` keys similar to current inputs:
```yaml
name: ci
on:
push:
branches: main
jobs:
login:
runs-on: ubuntu-latest
steps:
-
name: Login to registries
uses: docker/login-action@v3
with:
logins: |
- username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
```
## Customizing ## Customizing
### inputs ### inputs
@@ -507,7 +537,7 @@ The following inputs can be used as `step.with` keys:
| `password` | String | | Password or personal access token for authenticating 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`) | | `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 | | `logout` | Bool | `true` | Log out from the Docker registry at the end of a job |
| `logins` | YAML | | Add other registries to authenticate to, defined as YAML objects | | `logins` | YAML | | Add multiple registries to authenticate to, defined as YAML objects |
## Contributing ## Contributing

View File

@@ -25,7 +25,7 @@ inputs:
default: 'true' default: 'true'
required: false required: false
logins: logins:
description: 'Add other registries to authenticate to, defined as YAML objects' description: 'Add multiple registries to authenticate to, defined as YAML objects'
required: false required: false
runs: runs:

View File

@@ -7,10 +7,10 @@ import * as docker from './docker';
import * as stateHelper from './state-helper'; import * as stateHelper from './state-helper';
interface Auth { interface Auth {
registry?: string; registry: string;
username: string; username: string;
password: string; password: string;
ecr?: string; ecr: string;
} }
export async function main(): Promise<void> { export async function main(): Promise<void> {