Compare commits

..

2 Commits

Author SHA1 Message Date
CrazyMax
20e0a61734 chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-06 17:18:40 +01:00
CrazyMax
f40589c4bf Add scope input to set scopes for the authentication token
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-01-06 17:17:09 +01:00
4 changed files with 13 additions and 7 deletions

View File

@@ -375,7 +375,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
scope: push
scope: '@push'
-
name: Print config.json files
shell: bash
@@ -405,7 +405,7 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
scope: docker/buildx-bin@push
scope: 'docker/buildx-bin@push'
-
name: Print config.json files
shell: bash
@@ -436,7 +436,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
scope: push
scope: '@push'
-
name: Print config.json files
shell: bash
@@ -467,7 +467,7 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
scope: docker/login-action@push
scope: 'docker/login-action@push'
-
name: Print config.json files
shell: bash

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

@@ -55,8 +55,14 @@ export async function loginECR(registry: string, username: string, password: str
async function loginExec(registry: string, username: string, password: string, scope?: string): Promise<void> {
let envs: {[key: string]: string} | undefined;
if (scope && scope.length > 0) {
let dockerConfigDir = path.join(Buildx.configDir, 'config', registry === 'docker.io' ? 'registry-1.docker.io' : registry);
if (scope.startsWith('@')) {
dockerConfigDir += scope;
} else {
dockerConfigDir = path.join(dockerConfigDir, scope);
}
envs = Object.assign({}, process.env, {
DOCKER_CONFIG: path.join(Buildx.configDir, 'config', registry, scope)
DOCKER_CONFIG: dockerConfigDir
}) as {
[key: string]: string;
};