From ae29a82e5ce84dd4774bdc3b9884c6eceef9bf30 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Thu, 2 May 2024 15:15:36 +0200 Subject: [PATCH] align interface fields with action inputs Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- __tests__/context.test.ts | 2 +- src/context.ts | 10 +++++----- src/main.ts | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/__tests__/context.test.ts b/__tests__/context.test.ts index 9984c68..e764eb5 100644 --- a/__tests__/context.test.ts +++ b/__tests__/context.test.ts @@ -340,7 +340,7 @@ describe('getArgs', () => { { files: inp.files, load: inp.load, - noCache: inp.noCache, + noCache: inp['no-cache'], overrides: inp.set, provenance: inp.provenance, push: inp.push, diff --git a/src/context.ts b/src/context.ts index b580013..9cfe644 100644 --- a/src/context.ts +++ b/src/context.ts @@ -15,7 +15,7 @@ export interface Inputs { files: string[]; workdir: string; targets: string[]; - noCache: boolean; + 'no-cache': boolean; pull: boolean; load: boolean; provenance: string; @@ -23,7 +23,7 @@ export interface Inputs { sbom: string; set: string[]; source: string; - githubToken: string; + 'github-token': string; } export async function getInputs(): Promise { @@ -32,7 +32,7 @@ export async function getInputs(): Promise { files: Util.getInputList('files'), workdir: core.getInput('workdir') || '.', targets: Util.getInputList('targets'), - noCache: core.getBooleanInput('no-cache'), + 'no-cache': core.getBooleanInput('no-cache'), pull: core.getBooleanInput('pull'), load: core.getBooleanInput('load'), provenance: Build.getProvenanceInput('provenance'), @@ -40,7 +40,7 @@ export async function getInputs(): Promise { sbom: core.getInput('sbom'), set: Util.getInputList('set', {ignoreComma: true, quote: false}), source: getSourceInput('source'), - githubToken: core.getInput('github-token') + 'github-token': core.getInput('github-token') }; } @@ -92,7 +92,7 @@ async function getBakeArgs(inputs: Inputs, definition: BakeDefinition, toolkit: async function getCommonArgs(inputs: Inputs): Promise> { const args: Array = []; - if (inputs.noCache) { + if (inputs['no-cache']) { args.push('--no-cache'); } if (inputs.builder) { diff --git a/src/main.ts b/src/main.ts index 6dbca4d..5a0a773 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,7 +21,7 @@ actionsToolkit.run( async () => { const inputs: context.Inputs = await context.getInputs(); const toolkit = new Toolkit(); - const gitAuthToken = process.env.BUILDX_BAKE_GIT_AUTH_TOKEN ?? inputs.githubToken; + const gitAuthToken = process.env.BUILDX_BAKE_GIT_AUTH_TOKEN ?? inputs['github-token']; await core.group(`GitHub Actions runtime token ACs`, async () => { try { @@ -82,7 +82,7 @@ actionsToolkit.run( { files: inputs.files, load: inputs.load, - noCache: inputs.noCache, + noCache: inputs['no-cache'], overrides: inputs.set, provenance: inputs.provenance, push: inputs.push,