Compare commits

..

5 Commits

Author SHA1 Message Date
CrazyMax
35f3630278
Merge b274a74e63 into df19a799eb 2024-05-14 13:19:55 +00:00
CrazyMax
b274a74e63
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-14 15:19:47 +02:00
CrazyMax
1a557b3d82
generate build summary
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-14 14:40:42 +02:00
CrazyMax
0af89ac169
export build record and upload artifact
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-14 14:40:42 +02:00
CrazyMax
8e3a402792
bump to actions-toolkit dev
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-14 14:40:42 +02:00
8 changed files with 23 additions and 37 deletions

View File

@ -256,12 +256,6 @@ The following outputs are available:
| `digest` | String | Image digest | | `digest` | String | Image digest |
| `metadata` | JSON | Build result metadata | | `metadata` | JSON | Build result metadata |
### environment variables
| Name | Type | Description |
|---------------------------|------|-------------------------------------------------|
| `DOCKER_BUILD_NO_SUMMARY` | Bool | If `true`, build summary generation is disabled |
## Troubleshooting ## Troubleshooting
See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) See [TROUBLESHOOTING.md](TROUBLESHOOTING.md)

4
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

2
dist/licenses.txt generated vendored
View File

@ -2807,7 +2807,7 @@ minimatch
ISC ISC
The ISC License The ISC License
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above purpose with or without fee is hereby granted, provided that the above

View File

@ -79,25 +79,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>> { export async function getArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
const context = handlebars.compile(inputs.context)({ const context = handlebars.compile(inputs.context)({
defaultContext: Context.gitContext() defaultContext: Context.gitContext()

View File

@ -136,10 +136,6 @@ actionsToolkit.run(
async () => { async () => {
if (stateHelper.buildRef.length > 0) { if (stateHelper.buildRef.length > 0) {
await core.group(`Generating build summary`, async () => { await core.group(`Generating build summary`, async () => {
if (process.env.DOCKER_BUILD_NO_SUMMARY && Util.parseBool(process.env.DOCKER_BUILD_NO_SUMMARY)) {
core.info('Summary disabled');
return;
}
try { try {
const buildxHistory = new BuildxHistory(); const buildxHistory = new BuildxHistory();
const exportRes = await buildxHistory.export({ const exportRes = await buildxHistory.export({

View File

@ -1,6 +1,6 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import {Inputs, sanitizeInputs} from './context'; import {Inputs} from './context';
export const tmpDir = process.env['STATE_tmpDir'] || ''; export const tmpDir = process.env['STATE_tmpDir'] || '';
export const inputs = process.env['STATE_inputs'] ? JSON.parse(process.env['STATE_inputs']) : undefined; export const inputs = process.env['STATE_inputs'] ? JSON.parse(process.env['STATE_inputs']) : undefined;
@ -11,7 +11,22 @@ export function setTmpDir(tmpDir: string) {
} }
export function setInputs(inputs: Inputs) { export function setInputs(inputs: Inputs) {
core.saveState('inputs', JSON.stringify(sanitizeInputs(inputs))); const newInputs = {};
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;
}
newInputs[key] = value;
}
core.saveState('inputs', JSON.stringify(newInputs));
} }
export function setBuildRef(buildRef: string) { export function setBuildRef(buildRef: string) {

View File

@ -1057,7 +1057,7 @@ __metadata:
"@docker/actions-toolkit@https://github.com/crazy-max/docker-actions-toolkit#summary-test": "@docker/actions-toolkit@https://github.com/crazy-max/docker-actions-toolkit#summary-test":
version: 0.0.0+unknown version: 0.0.0+unknown
resolution: "@docker/actions-toolkit@https://github.com/crazy-max/docker-actions-toolkit.git#commit=bb135ac93a8bf3ff63207e56e2fdcd4c1f4fe8d2" resolution: "@docker/actions-toolkit@https://github.com/crazy-max/docker-actions-toolkit.git#commit=3bf4429db863cb5fc40af57778d3dc44b794d5a0"
dependencies: dependencies:
"@actions/artifact": ^2.1.7 "@actions/artifact": ^2.1.7
"@actions/cache": ^3.2.4 "@actions/cache": ^3.2.4
@ -1077,7 +1077,7 @@ __metadata:
jwt-decode: ^4.0.0 jwt-decode: ^4.0.0
semver: ^7.6.2 semver: ^7.6.2
tmp: ^0.2.3 tmp: ^0.2.3
checksum: 1bdcfebcb3d7d6a16942e8418e5b9ef93270eb686b3f00de831d0f26f6dc41f6aef4314c5321616789bcfd4adf2b5640092fffa17b07528aed18ce8a9ea4b54c checksum: d285217419e425f116ea85f6abf10e9cb2604f28f7760e8cf374f1b756c8529e7d098bcd224929a89b4c4b4b00c10a7f0591cfb9dc649bdb9dc9604a687e31e2
languageName: node languageName: node
linkType: hard linkType: hard