mirror of
https://github.com/docker/login-action.git
synced 2026-02-27 00:14:45 +08:00
Compare commits
4 Commits
b614728cdc
...
c6fa29c05d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c6fa29c05d | ||
|
|
cf9719557a | ||
|
|
bc6da454b9 | ||
|
|
8474404dec |
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -301,9 +301,11 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
add: |
|
||||
- registry: ${{ secrets.GAR_LOCATION }}-docker.pkg.dev
|
||||
username: _json_key
|
||||
password: ${{ secrets.GAR_JSON_KEY }}
|
||||
- username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- registry: public.ecr.aws
|
||||
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
- registry: registry.gitlab.com
|
||||
username: ${{ secrets.GITLAB_USERNAME }}
|
||||
password: ${{ secrets.GITLAB_TOKEN }}
|
||||
|
||||
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@@ -36,11 +36,7 @@ export async function loginStandard(registry: string, username: string, password
|
||||
loginArgs.push('--username', username);
|
||||
loginArgs.push(registry);
|
||||
|
||||
if (registry) {
|
||||
core.info(`Logging into ${registry}...`);
|
||||
} else {
|
||||
core.info(`Logging into Docker Hub...`);
|
||||
}
|
||||
core.info(`Logging into ${registry}...`);
|
||||
await Docker.getExecOutput(loginArgs, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
|
||||
@@ -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> {
|
||||
@@ -46,11 +46,11 @@ export async function main(): Promise<void> {
|
||||
throw new Error('No registry to login');
|
||||
}
|
||||
if (auths.length === 1) {
|
||||
await docker.login(auths[0].registry, auths[0].username, auths[0].password, auths[0].ecr || 'auto');
|
||||
await docker.login(auths[0].registry || 'docker.io', auths[0].username, auths[0].password, auths[0].ecr || 'auto');
|
||||
} else {
|
||||
for (const auth of auths) {
|
||||
await core.group(`Login to ${auth.registry || 'docker.io'}`, async () => {
|
||||
await docker.login(auth.registry, auth.username, auth.password, auth.ecr || 'auto');
|
||||
await docker.login(auth.registry || 'docker.io', auth.username, auth.password, auth.ecr || 'auto');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user