mirror of
https://github.com/docker/login-action.git
synced 2025-11-05 19:56:22 +08:00
Compare commits
2 Commits
508c654904
...
6c096ac234
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c096ac234 | ||
|
|
eaed1d819a |
32
README.md
32
README.md
@@ -24,7 +24,6 @@ ___
|
||||
* [OCI Oracle Cloud Infrastructure Registry (OCIR)](#oci-oracle-cloud-infrastructure-registry-ocir)
|
||||
* [Quay.io](#quayio)
|
||||
* [DigitalOcean](#digitalocean-container-registry)
|
||||
* [Authenticate to multiple registries](#authenticate-to-multiple-registries)
|
||||
* [Customizing](#customizing)
|
||||
* [inputs](#inputs)
|
||||
* [Contributing](#contributing)
|
||||
@@ -495,35 +494,6 @@ jobs:
|
||||
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
|
||||
|
||||
### inputs
|
||||
@@ -537,7 +507,7 @@ 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 |
|
||||
| `logins` | YAML | | Add multiple registries to authenticate to, defined as YAML objects |
|
||||
| `logins` | YAML | | Add other registries to authenticate to, defined as YAML objects |
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ inputs:
|
||||
default: 'true'
|
||||
required: false
|
||||
logins:
|
||||
description: 'Add multiple registries to authenticate to, defined as YAML objects'
|
||||
description: 'Add other registries to authenticate to, defined as YAML objects'
|
||||
required: false
|
||||
|
||||
runs:
|
||||
|
||||
@@ -7,10 +7,10 @@ import * as docker from './docker';
|
||||
import * as stateHelper from './state-helper';
|
||||
|
||||
interface Auth {
|
||||
registry: string;
|
||||
registry?: string;
|
||||
username: string;
|
||||
password: string;
|
||||
ecr: string;
|
||||
ecr?: string;
|
||||
}
|
||||
|
||||
export async function main(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user