Merge pull request #1458 from crazy-max/git-auth-port
Some checks failed
validate / prepare (push) Successful in 11s
test / test (push) Successful in 38s
validate / validate (push) Successful in 1m12s
e2e / build (Azure Container Registry, AZURE_CLIENT_SECRET, officialgithubactions.azurecr.io, officialgithubactions.azurecr.io/test-docker-action, remote, AZURE_CLIENT_ID) (push) Failing after 54s
e2e / build (GitHub, GHCR_PAT, ghcr.io, ghcr.io/docker-ghactiontest/test, remote, GHCR_USERNAME) (push) Failing after 54s
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) Failing after 52s
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) Failing after 57s
e2e / build (Artifactory, ARTIFACTORY_TOKEN, infradock.jfrog.io, infradock.jfrog.io/test-ghaction/build-push-action, remote, ARTIFACTORY_USERNAME) (push) Failing after 56s
e2e / build (GitLab, GITLAB_TOKEN, registry.gitlab.com, registry.gitlab.com/test1716/test, remote, GITLAB_USERNAME) (push) Failing after 55s
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) Failing after 53s
e2e / build (Docker Hub, DOCKERHUB_TOKEN, , ghactionstest/ghactionstest, remote, DOCKERHUB_USERNAME) (push) Failing after 55s
ci / path-context (push) Failing after 6s
e2e / build (distribution, Distribution, local) (push) Failing after 26s
e2e / build (harbor, Harbor, local) (push) Failing after 24s
e2e / build (nexus, Nexus, local) (push) Failing after 26s
ci / example (push) Failing after 8s
ci / error (push) Failing after 11s
ci / docker-driver (push) Failing after 9s
e2e / build (Quay, QUAY_TOKEN, quay.io, quay.io/docker_build_team/ghactiontest, remote, QUAY_USERNAME) (push) Failing after 42s
ci / export-docker (push) Successful in 13s
ci / error-buildx (push) Successful in 32s
ci / secret (push) Successful in 20s
ci / secret-envs (push) Successful in 19s
ci / network (push) Successful in 19s
ci / minimal (push) Successful in 1m1s
ci / shm-size (push) Successful in 20s
ci / ulimit (push) Successful in 21s
ci / attests-compat (moby/buildkit:buildx-stable-1, v0.9.1) (push) Failing after 13s
ci / add-hosts (push) Successful in 25s
ci / cgroup-parent (push) Successful in 26s
ci / no-cache-filters (push) Successful in 24s
ci / provenance (, /tmp/buildx-build, binary) (push) Failing after 6s
ci / provenance (, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 6s
ci / provenance (mode=max, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 6s
ci / sbom (/tmp/buildx-build, binary) (push) Failing after 5s
ci / git-context (push) Failing after 1m37s
ci / attests-compat (moby/buildkit:buildx-stable-1, latest) (push) Successful in 37s
ci / multi (multi) (push) Failing after 6s
ci / multi (multi-sudo) (push) Failing after 6s
ci / digest (docker, false, false) (push) Failing after 6s
ci / git-context-secret (push) Failing after 1m36s
ci / attests-compat (moby/buildkit:v0.10.6, latest) (push) Successful in 31s
ci / digest (docker, false, true) (push) Failing after 6s
ci / digest (docker, true, false) (push) Failing after 6s
ci / attests-compat (moby/buildkit:latest, edge) (push) Successful in 35s
ci / digest (docker-container, false, false) (push) Failing after 6s
ci / provenance (mode=max, /tmp/buildx-build, binary) (push) Failing after 32s
ci / digest (docker-container, false, true) (push) Failing after 6s
ci / github-cache (push) Failing after 6s
ci / local-cache (push) Failing after 6s
ci / named-context-container (push) Failing after 7s
ci / docker-config-malformed (push) Successful in 12s
ci / proxy-docker-config (push) Failing after 7s
ci / sbom (type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 39s
ci / named-context-docker (push) Successful in 17s
ci / digest (docker-container, true, false) (push) Successful in 23s
ci / standalone (push) Successful in 19s
ci / named-context-pin (push) Successful in 20s
ci / proxy-buildkitd (push) Failing after 7s
ci / annotations (push) Failing after 6s
ci / multi-output (push) Failing after 6s
ci / registry-cache (push) Failing after 32s
ci / summary-not-supported (push) Failing after 11s
ci / load-and-push (push) Failing after 30s
ci / checks (edge) (push) Successful in 19s
ci / checks (latest) (push) Successful in 19s
ci / checks (v0.14.1) (push) Successful in 17s
ci / annotations-disabled (push) Successful in 25s
ci / call-check (push) Successful in 22s
ci / summary-disable (push) Successful in 2m47s
ci / summary-disable-deprecated (push) Successful in 3m3s
ci / record-retention-days (0) (push) Successful in 3m5s
ci / record-retention-days (2) (push) Successful in 3m9s
ci / export-legacy (false) (push) Successful in 3m16s
ci / record-upload-disable (push) Successful in 3m30s
ci / export-legacy (true) (push) Successful in 3m26s
ci / no-default-attestations (push) Successful in 1m50s

preserve port in GIT_AUTH_TOKEN host
This commit is contained in:
CrazyMax
2026-02-12 09:49:36 +01:00
committed by GitHub
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'] ['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', '[%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) => { 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())) { 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']) { if (inputs['shm-size']) {
args.push('--shm-size', inputs['shm-size']); args.push('--shm-size', inputs['shm-size']);