Skip to content

Commit

Permalink
Merge pull request #27 from crazy-max/bool-input
Browse files Browse the repository at this point in the history
Use `core.getBooleanInput`
  • Loading branch information
crazy-max authored May 26, 2021
2 parents e0c3724 + 41a29e2 commit 03bdd49
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
Binary file added .github/bake-action.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ of this action in your workflow (i.e `docker/[email protected]`).
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)
Expand Down
2 changes: 1 addition & 1 deletion __tests__/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`;
}
Expand Down
9 changes: 4 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
}
Expand Down
2 changes: 0 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 03bdd49

Please sign in to comment.