Use core.getBooleanInput

This commit is contained in:
CrazyMax
2021-05-26 15:22:18 +02:00
parent e0c37242bd
commit 41a29e21ad
6 changed files with 11 additions and 12 deletions

BIN
.github/bake-action.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -14,6 +14,8 @@ of this action in your workflow (i.e `docker/bake-action@v1.1.3`).
GitHub Action to use Docker [Buildx Bake](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md)
as a high-level build command.
![Screenshot](.github/bake-action.png)
___
* [Usage](#usage)

View File

@ -188,7 +188,7 @@ describe('setOutput', () => {
});
});
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
// See: https://github.com/actions/toolkit/blob/a1b068ec31a042ff1e10a522d8fdf0b8869d53ca/packages/core/src/core.ts#L89
function getInputName(name: string): string {
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
}

9
dist/index.js generated vendored
View File

@ -533,7 +533,6 @@ function run() {
return;
}
const bxVersion = yield buildx.getVersion();
core.debug(`buildx version: ${bxVersion}`);
const inputs = yield context.getInputs();
const args = yield context.getArgs(inputs, bxVersion);
core.startGroup(`Bake definition`);
@ -5797,10 +5796,10 @@ function getInputs() {
builder: core.getInput('builder'),
files: getInputList('files'),
targets: getInputList('targets'),
noCache: /true/i.test(core.getInput('no-cache')),
pull: /true/i.test(core.getInput('pull')),
load: /true/i.test(core.getInput('load')),
push: /true/i.test(core.getInput('push')),
noCache: core.getBooleanInput('no-cache'),
pull: core.getBooleanInput('pull'),
load: core.getBooleanInput('load'),
push: core.getBooleanInput('push'),
set: getInputList('set', true)
};
});

View File

@ -19,10 +19,10 @@ export async function getInputs(): Promise<Inputs> {
builder: core.getInput('builder'),
files: getInputList('files'),
targets: getInputList('targets'),
noCache: /true/i.test(core.getInput('no-cache')),
pull: /true/i.test(core.getInput('pull')),
load: /true/i.test(core.getInput('load')),
push: /true/i.test(core.getInput('push')),
noCache: core.getBooleanInput('no-cache'),
pull: core.getBooleanInput('pull'),
load: core.getBooleanInput('load'),
push: core.getBooleanInput('push'),
set: getInputList('set', true)
};
}

View File

@ -17,8 +17,6 @@ async function run(): Promise<void> {
}
const bxVersion = await buildx.getVersion();
core.debug(`buildx version: ${bxVersion}`);
const inputs: context.Inputs = await context.getInputs();
const args: string[] = await context.getArgs(inputs, bxVersion);