Merge pull request #1458 from crazy-max/git-auth-port
Some checks failed
ci / checks (latest) (push) Has been cancelled
ci / checks (v0.14.1) (push) Has been cancelled
ci / annotations-disabled (push) Has been cancelled
ci / no-default-attestations (push) Has been cancelled
e2e / build (AWS ECR Public, AWS_SECRET_ACCESS_KEY, public.ecr.aws, public.ecr.aws/q3b5f1u4/test-docker-action, remote, AWS_ACCESS_KEY_ID) (push) Has been cancelled
e2e / build (AWS ECR, AWS_SECRET_ACCESS_KEY, 175142243308.dkr.ecr.us-east-2.amazonaws.com, 175142243308.dkr.ecr.us-east-2.amazonaws.com/sandbox/test-docker-action, remote, AWS_ACCESS_KEY_ID) (push) Has been cancelled
e2e / build (Google Artifact Registry, GAR_JSON_KEY, us-east4-docker.pkg.dev, us-east4-docker.pkg.dev/sandbox-298914/docker-official-github-actions/test-docker-action, remote, GAR_USERNAME) (push) Has been cancelled
e2e / build (Quay, QUAY_TOKEN, quay.io, quay.io/docker_build_team/ghactiontest, remote, QUAY_USERNAME) (push) Has been cancelled
test / test (push) Has been cancelled
e2e / build (harbor, Harbor, local) (push) Has been cancelled
e2e / build (nexus, Nexus, local) (push) Has been cancelled
e2e / build (Artifactory, ARTIFACTORY_TOKEN, infradock.jfrog.io, infradock.jfrog.io/test-ghaction/build-push-action, remote, ARTIFACTORY_USERNAME) (push) Has been cancelled
e2e / build (Azure Container Registry, AZURE_CLIENT_SECRET, officialgithubactions.azurecr.io, officialgithubactions.azurecr.io/test-docker-action, remote, AZURE_CLIENT_ID) (push) Has been cancelled
e2e / build (Docker Hub, DOCKERHUB_TOKEN, , ghactionstest/ghactionstest, remote, DOCKERHUB_USERNAME) (push) Has been cancelled
e2e / build (GitLab, GITLAB_TOKEN, registry.gitlab.com, registry.gitlab.com/test1716/test, remote, GITLAB_USERNAME) (push) Has been cancelled
validate / prepare (push) Has been cancelled
validate / validate (push) Has been cancelled
ci / secret-envs (push) Has been cancelled
ci / shm-size (push) Has been cancelled
ci / ulimit (push) Has been cancelled
ci / add-hosts (push) Has been cancelled
ci / attests-compat (moby/buildkit:buildx-stable-1, latest) (push) Has been cancelled
ci / provenance (, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Has been cancelled
ci / sbom (/tmp/buildx-build, binary) (push) Has been cancelled
ci / sbom (type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Has been cancelled
ci / multi (multi-sudo) (push) Has been cancelled
ci / digest (docker-container, false, false) (push) Has been cancelled
ci / record-upload-disable (push) Has been cancelled
ci / record-retention-days (2) (push) Has been cancelled
ci / export-legacy (false) (push) Has been cancelled
ci / minimal (push) Has been cancelled
ci / git-context (push) Has been cancelled
ci / local-cache (push) Has been cancelled
ci / proxy-docker-config (push) Has been cancelled
ci / git-context-secret (push) Has been cancelled
ci / path-context (push) Has been cancelled
ci / error (push) Has been cancelled
ci / example (push) Has been cancelled
ci / provenance (mode=max, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Has been cancelled
ci / call-check (push) Has been cancelled
ci / error-buildx (push) Has been cancelled
ci / network (push) Has been cancelled
ci / digest (docker, true, false) (push) Has been cancelled
ci / docker-driver (push) Has been cancelled
ci / secret (push) Has been cancelled
ci / export-docker (push) Has been cancelled
ci / cgroup-parent (push) Has been cancelled
ci / attests-compat (moby/buildkit:buildx-stable-1, v0.9.1) (push) Has been cancelled
ci / no-cache-filters (push) Has been cancelled
ci / github-cache (push) Has been cancelled
ci / standalone (push) Has been cancelled
ci / named-context-pin (push) Has been cancelled
ci / named-context-docker (push) Has been cancelled
ci / load-and-push (push) Has been cancelled
ci / attests-compat (moby/buildkit:latest, edge) (push) Has been cancelled
ci / attests-compat (moby/buildkit:v0.10.6, latest) (push) Has been cancelled
ci / digest (docker-container, false, true) (push) Has been cancelled
ci / digest (docker-container, true, false) (push) Has been cancelled
ci / provenance (, /tmp/buildx-build, binary) (push) Has been cancelled
ci / provenance (mode=max, /tmp/buildx-build, binary) (push) Has been cancelled
ci / summary-disable (push) Has been cancelled
ci / multi-output (push) Has been cancelled
ci / multi (multi) (push) Has been cancelled
ci / digest (docker, false, false) (push) Has been cancelled
ci / digest (docker, false, true) (push) Has been cancelled
ci / registry-cache (push) Has been cancelled
ci / summary-not-supported (push) Has been cancelled
ci / named-context-container (push) Has been cancelled
ci / docker-config-malformed (push) Has been cancelled
ci / summary-disable-deprecated (push) Has been cancelled
e2e / build (GitHub, GHCR_PAT, ghcr.io, ghcr.io/docker-ghactiontest/test, remote, GHCR_USERNAME) (push) Has been cancelled
e2e / build (distribution, Distribution, local) (push) Has been cancelled
ci / proxy-buildkitd (push) Has been cancelled
ci / record-retention-days (0) (push) Has been cancelled
ci / annotations (push) Has been cancelled
ci / export-legacy (true) (push) Has been cancelled
ci / checks (edge) (push) Has been cancelled

preserve port in GIT_AUTH_TOKEN host
This commit is contained in:
CrazyMax 2026-02-12 09:49:36 +01:00 committed by GitHub
commit 10e90e3645
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 49 additions and 3 deletions

View file

@ -857,6 +857,52 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
['BUILDX_NO_DEFAULT_ATTESTATIONS', '1']
])
],
[
35,
'0.13.1',
new Map<string, string>([
['github-token', 'abcdefghijklmno0123456789'],
['context', '{{defaultContext}}'],
['load', 'false'],
['no-cache', 'false'],
['push', 'false'],
['pull', 'false'],
]),
[
'build',
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=http://10.0.0.5:22827/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--secret', `id=GIT_AUTH_TOKEN.10.0.0.5:22827,src=${tmpName}`,
'--metadata-file', metadataJson,
'http://10.0.0.5:22827/docker/build-push-action.git#refs/heads/master'
],
new Map<string, string>([
['GITHUB_SERVER_URL', 'http://10.0.0.5:22827'],
])
],
[
36,
'0.13.1',
new Map<string, string>([
['github-token', 'abcdefghijklmno0123456789'],
['context', '{{defaultContext}}'],
['load', 'false'],
['no-cache', 'false'],
['push', 'false'],
['pull', 'false'],
]),
[
'build',
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.cds.internal.unity3d.com/docker/build-push-action/actions/runs/123456789/attempts/1`,
'--secret', `id=GIT_AUTH_TOKEN.github.cds.internal.unity3d.com,src=${tmpName}`,
'--metadata-file', metadataJson,
'https://github.cds.internal.unity3d.com/docker/build-push-action.git#refs/heads/master'
],
new Map<string, string>([
['GITHUB_SERVER_URL', 'https://github.cds.internal.unity3d.com'],
])
],
])(
'[%d] given %p with %p as inputs, returns %p',
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>, envs: Map<string, string> | undefined) => {

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

@ -183,7 +183,7 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
}
});
if (inputs['github-token'] && !Build.hasGitAuthTokenSecret(inputs.secrets) && context.startsWith(Context.gitContext())) {
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN.${new URL(GitHub.serverURL).hostname.trimEnd()}=${inputs['github-token']}`));
args.push('--secret', Build.resolveSecretString(`GIT_AUTH_TOKEN.${new URL(GitHub.serverURL).host.trimEnd()}=${inputs['github-token']}`));
}
if (inputs['shm-size']) {
args.push('--shm-size', inputs['shm-size']);