mirror of
https://github.com/docker/build-push-action.git
synced 2025-12-06 07:48:21 +08:00
Merge pull request #1353 from crazy-max/summary-secret-keys
Some checks failed
test / test (push) Failing after 20s
validate / prepare (push) Failing after 14s
validate / validate (push) Has been skipped
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 8s
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 9s
e2e / build (Artifactory, ARTIFACTORY_TOKEN, infradock.jfrog.io, infradock.jfrog.io/test-ghaction/build-push-action, remote, ARTIFACTORY_USERNAME) (push) Failing after 10s
e2e / build (Azure Container Registry, AZURE_CLIENT_SECRET, officialgithubactions.azurecr.io, officialgithubactions.azurecr.io/test-docker-action, remote, AZURE_CLIENT_ID) (push) Failing after 8s
e2e / build (Docker Hub, DOCKERHUB_TOKEN, , ghactionstest/ghactionstest, remote, DOCKERHUB_USERNAME) (push) Failing after 9s
e2e / build (GitHub, GHCR_PAT, ghcr.io, ghcr.io/docker-ghactiontest/test, remote, GHCR_USERNAME) (push) Failing after 8s
e2e / build (GitLab, GITLAB_TOKEN, registry.gitlab.com, registry.gitlab.com/test1716/test, remote, GITLAB_USERNAME) (push) Failing after 13s
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 8s
e2e / build (Quay, QUAY_TOKEN, quay.io, quay.io/docker_build_team/ghactiontest, remote, QUAY_USERNAME) (push) Failing after 8s
e2e / build (harbor, Harbor, local) (push) Failing after 10s
e2e / build (nexus, Nexus, local) (push) Failing after 8s
ci / minimal (push) Failing after 20s
ci / git-context (push) Failing after 36s
ci / git-context-secret (push) Failing after 35s
ci / path-context (push) Failing after 30s
ci / example (push) Failing after 26s
ci / error (push) Failing after 21s
ci / error-buildx (push) Failing after 11s
ci / docker-driver (push) Successful in 34s
ci / export-docker (push) Successful in 25s
ci / secret (push) Failing after 20s
ci / secret-envs (push) Failing after 20s
ci / network (push) Failing after 20s
ci / shm-size (push) Failing after 20s
ci / ulimit (push) Failing after 20s
ci / cgroup-parent (push) Failing after 10s
ci / add-hosts (push) Failing after 20s
ci / no-cache-filters (push) Failing after 20s
ci / attests-compat (moby/buildkit:buildx-stable-1, latest) (push) Failing after 20s
ci / attests-compat (moby/buildkit:buildx-stable-1, v0.9.1) (push) Failing after 20s
ci / attests-compat (moby/buildkit:latest, edge) (push) Failing after 20s
ci / attests-compat (moby/buildkit:v0.10.6, latest) (push) Failing after 20s
ci / provenance (, /tmp/buildx-build, binary) (push) Failing after 25s
ci / provenance (, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 26s
ci / provenance (mode=max, /tmp/buildx-build, binary) (push) Failing after 25s
ci / provenance (mode=max, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 26s
ci / sbom (/tmp/buildx-build, binary) (push) Failing after 25s
e2e / build (distribution, Distribution, local) (push) Failing after 11m0s
e2e / build (Google Container Registry, GCR_JSON_KEY, gcr.io, gcr.io/sandbox-298914/test-docker-action, remote, GCR_USERNAME) (push) Failing after 11m21s
ci / sbom (type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 25s
ci / multi (multi) (push) Failing after 31s
ci / multi (multi-sudo) (push) Failing after 25s
ci / digest (docker, false, false) (push) Failing after 25s
ci / digest (docker, false, true) (push) Failing after 26s
ci / digest (docker, true, false) (push) Failing after 30s
ci / digest (docker-container, false, false) (push) Failing after 25s
ci / digest (docker-container, false, true) (push) Failing after 25s
ci / digest (docker-container, true, false) (push) Failing after 30s
ci / registry-cache (push) Failing after 26s
ci / github-cache (push) Failing after 25s
ci / local-cache (push) Failing after 30s
ci / standalone (push) Failing after 21s
ci / named-context-pin (push) Failing after 20s
ci / named-context-docker (push) Failing after 21s
ci / named-context-container (push) Failing after 25s
ci / docker-config-malformed (push) Successful in 26s
ci / proxy-docker-config (push) Failing after 34s
ci / proxy-buildkitd (push) Failing after 31s
ci / annotations (push) Failing after 26s
ci / multi-output (push) Failing after 25s
ci / load-and-push (push) Failing after 25s
ci / summary-disable (push) Failing after 10s
ci / summary-disable-deprecated (push) Failing after 20s
ci / summary-not-supported (push) Failing after 20s
ci / record-upload-disable (push) Failing after 20s
ci / record-retention-days (0) (push) Failing after 20s
ci / record-retention-days (2) (push) Failing after 20s
ci / checks (edge) (push) Failing after 20s
ci / checks (latest) (push) Failing after 20s
ci / checks (v0.14.1) (push) Failing after 20s
ci / annotations-disabled (push) Failing after 20s
ci / call-check (push) Failing after 20s
Some checks failed
test / test (push) Failing after 20s
validate / prepare (push) Failing after 14s
validate / validate (push) Has been skipped
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 8s
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 9s
e2e / build (Artifactory, ARTIFACTORY_TOKEN, infradock.jfrog.io, infradock.jfrog.io/test-ghaction/build-push-action, remote, ARTIFACTORY_USERNAME) (push) Failing after 10s
e2e / build (Azure Container Registry, AZURE_CLIENT_SECRET, officialgithubactions.azurecr.io, officialgithubactions.azurecr.io/test-docker-action, remote, AZURE_CLIENT_ID) (push) Failing after 8s
e2e / build (Docker Hub, DOCKERHUB_TOKEN, , ghactionstest/ghactionstest, remote, DOCKERHUB_USERNAME) (push) Failing after 9s
e2e / build (GitHub, GHCR_PAT, ghcr.io, ghcr.io/docker-ghactiontest/test, remote, GHCR_USERNAME) (push) Failing after 8s
e2e / build (GitLab, GITLAB_TOKEN, registry.gitlab.com, registry.gitlab.com/test1716/test, remote, GITLAB_USERNAME) (push) Failing after 13s
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 8s
e2e / build (Quay, QUAY_TOKEN, quay.io, quay.io/docker_build_team/ghactiontest, remote, QUAY_USERNAME) (push) Failing after 8s
e2e / build (harbor, Harbor, local) (push) Failing after 10s
e2e / build (nexus, Nexus, local) (push) Failing after 8s
ci / minimal (push) Failing after 20s
ci / git-context (push) Failing after 36s
ci / git-context-secret (push) Failing after 35s
ci / path-context (push) Failing after 30s
ci / example (push) Failing after 26s
ci / error (push) Failing after 21s
ci / error-buildx (push) Failing after 11s
ci / docker-driver (push) Successful in 34s
ci / export-docker (push) Successful in 25s
ci / secret (push) Failing after 20s
ci / secret-envs (push) Failing after 20s
ci / network (push) Failing after 20s
ci / shm-size (push) Failing after 20s
ci / ulimit (push) Failing after 20s
ci / cgroup-parent (push) Failing after 10s
ci / add-hosts (push) Failing after 20s
ci / no-cache-filters (push) Failing after 20s
ci / attests-compat (moby/buildkit:buildx-stable-1, latest) (push) Failing after 20s
ci / attests-compat (moby/buildkit:buildx-stable-1, v0.9.1) (push) Failing after 20s
ci / attests-compat (moby/buildkit:latest, edge) (push) Failing after 20s
ci / attests-compat (moby/buildkit:v0.10.6, latest) (push) Failing after 20s
ci / provenance (, /tmp/buildx-build, binary) (push) Failing after 25s
ci / provenance (, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 26s
ci / provenance (mode=max, /tmp/buildx-build, binary) (push) Failing after 25s
ci / provenance (mode=max, type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 26s
ci / sbom (/tmp/buildx-build, binary) (push) Failing after 25s
e2e / build (distribution, Distribution, local) (push) Failing after 11m0s
e2e / build (Google Container Registry, GCR_JSON_KEY, gcr.io, gcr.io/sandbox-298914/test-docker-action, remote, GCR_USERNAME) (push) Failing after 11m21s
ci / sbom (type=image,name=localhost:5000/name/app:latest,push=true, image) (push) Failing after 25s
ci / multi (multi) (push) Failing after 31s
ci / multi (multi-sudo) (push) Failing after 25s
ci / digest (docker, false, false) (push) Failing after 25s
ci / digest (docker, false, true) (push) Failing after 26s
ci / digest (docker, true, false) (push) Failing after 30s
ci / digest (docker-container, false, false) (push) Failing after 25s
ci / digest (docker-container, false, true) (push) Failing after 25s
ci / digest (docker-container, true, false) (push) Failing after 30s
ci / registry-cache (push) Failing after 26s
ci / github-cache (push) Failing after 25s
ci / local-cache (push) Failing after 30s
ci / standalone (push) Failing after 21s
ci / named-context-pin (push) Failing after 20s
ci / named-context-docker (push) Failing after 21s
ci / named-context-container (push) Failing after 25s
ci / docker-config-malformed (push) Successful in 26s
ci / proxy-docker-config (push) Failing after 34s
ci / proxy-buildkitd (push) Failing after 31s
ci / annotations (push) Failing after 26s
ci / multi-output (push) Failing after 25s
ci / load-and-push (push) Failing after 25s
ci / summary-disable (push) Failing after 10s
ci / summary-disable-deprecated (push) Failing after 20s
ci / summary-not-supported (push) Failing after 20s
ci / record-upload-disable (push) Failing after 20s
ci / record-retention-days (0) (push) Failing after 20s
ci / record-retention-days (2) (push) Failing after 20s
ci / checks (edge) (push) Failing after 20s
ci / checks (latest) (push) Failing after 20s
ci / checks (v0.14.1) (push) Failing after 20s
ci / annotations-disabled (push) Failing after 20s
ci / call-check (push) Failing after 20s
only print secret keys in build summary output
This commit is contained in:
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
@@ -81,25 +81,6 @@ export async function getInputs(): Promise<Inputs> {
|
||||
};
|
||||
}
|
||||
|
||||
export function sanitizeInputs(inputs: Inputs) {
|
||||
const res = {};
|
||||
for (const key of Object.keys(inputs)) {
|
||||
if (key === 'github-token') {
|
||||
continue;
|
||||
}
|
||||
const value: string | string[] | boolean = inputs[key];
|
||||
if (typeof value === 'boolean' && value === false) {
|
||||
continue;
|
||||
} else if (Array.isArray(value) && value.length === 0) {
|
||||
continue;
|
||||
} else if (!value) {
|
||||
continue;
|
||||
}
|
||||
res[key] = value;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
export async function getArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
|
||||
const context = handlebars.compile(inputs.context)({
|
||||
defaultContext: Context.gitContext()
|
||||
|
||||
@@ -24,8 +24,8 @@ actionsToolkit.run(
|
||||
async () => {
|
||||
const startedTime = new Date();
|
||||
const inputs: context.Inputs = await context.getInputs();
|
||||
stateHelper.setSummaryInputs(inputs);
|
||||
core.debug(`inputs: ${JSON.stringify(inputs)}`);
|
||||
stateHelper.setInputs(inputs);
|
||||
|
||||
const toolkit = new Toolkit();
|
||||
|
||||
@@ -216,7 +216,7 @@ actionsToolkit.run(
|
||||
await GitHub.writeBuildSummary({
|
||||
exportRes: exportRes,
|
||||
uploadRes: uploadRes,
|
||||
inputs: stateHelper.inputs
|
||||
inputs: stateHelper.summaryInputs
|
||||
});
|
||||
} catch (e) {
|
||||
core.warning(e.message);
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import {Inputs, sanitizeInputs} from './context';
|
||||
import {Build} from '@docker/actions-toolkit/lib/buildx/build';
|
||||
|
||||
import {Inputs} from './context';
|
||||
|
||||
export const tmpDir = process.env['STATE_tmpDir'] || '';
|
||||
export const inputs = process.env['STATE_inputs'] ? JSON.parse(process.env['STATE_inputs']) : undefined;
|
||||
export const buildRef = process.env['STATE_buildRef'] || '';
|
||||
export const isSummarySupported = !!process.env['STATE_isSummarySupported'];
|
||||
export const summaryInputs = process.env['STATE_summaryInputs'] ? JSON.parse(process.env['STATE_summaryInputs']) : undefined;
|
||||
|
||||
export function setTmpDir(tmpDir: string) {
|
||||
core.saveState('tmpDir', tmpDir);
|
||||
}
|
||||
|
||||
export function setInputs(inputs: Inputs) {
|
||||
core.saveState('inputs', JSON.stringify(sanitizeInputs(inputs)));
|
||||
}
|
||||
|
||||
export function setBuildRef(buildRef: string) {
|
||||
core.saveState('buildRef', buildRef);
|
||||
}
|
||||
@@ -22,3 +20,39 @@ export function setBuildRef(buildRef: string) {
|
||||
export function setSummarySupported() {
|
||||
core.saveState('isSummarySupported', 'true');
|
||||
}
|
||||
|
||||
export function setSummaryInputs(inputs: Inputs) {
|
||||
const res = {};
|
||||
for (const key of Object.keys(inputs)) {
|
||||
if (key === 'github-token') {
|
||||
continue;
|
||||
}
|
||||
const value: string | string[] | boolean = inputs[key];
|
||||
if (typeof value === 'boolean' && !value) {
|
||||
continue;
|
||||
} else if (Array.isArray(value)) {
|
||||
if (value.length === 0) {
|
||||
continue;
|
||||
} else if (key === 'secrets' && value.length > 0) {
|
||||
const secretKeys: string[] = [];
|
||||
for (const secret of value) {
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [skey, _] = Build.parseSecretKvp(secret, true);
|
||||
secretKeys.push(skey);
|
||||
} catch (err) {
|
||||
// ignore invalid secret
|
||||
}
|
||||
}
|
||||
if (secretKeys.length > 0) {
|
||||
res[key] = secretKeys;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
} else if (!value) {
|
||||
continue;
|
||||
}
|
||||
res[key] = value;
|
||||
}
|
||||
core.saveState('summaryInputs', JSON.stringify(res));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user