Add working-directory option
Signed-off-by: Danilo Tuler <tuler@pobox.com>
This commit is contained in:
@@ -82,6 +82,7 @@ Following inputs can be used as `step.with` keys
|
|||||||
|------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) |
|
| `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) |
|
||||||
| `files` | List/CSV | List of [bake definition files](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md#file) |
|
| `files` | List/CSV | List of [bake definition files](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md#file) |
|
||||||
|
| `workdir` | String | Working directory of execution |
|
||||||
| `targets` | List/CSV | List of bake targets |
|
| `targets` | List/CSV | List of bake targets |
|
||||||
| `no-cache` | Bool | Do not use cache when building the image (default `false`) |
|
| `no-cache` | Bool | Do not use cache when building the image (default `false`) |
|
||||||
| `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) |
|
| `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) |
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ inputs:
|
|||||||
files:
|
files:
|
||||||
description: "List of bake definition files"
|
description: "List of bake definition files"
|
||||||
required: true
|
required: true
|
||||||
|
workdir:
|
||||||
|
description: "Working directory of bake execution"
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
targets:
|
targets:
|
||||||
description: "List of bake targets"
|
description: "List of bake targets"
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
4
dist/index.js
generated
vendored
4
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
@@ -12,6 +12,7 @@ let _tmpDir: string;
|
|||||||
export interface Inputs {
|
export interface Inputs {
|
||||||
builder: string;
|
builder: string;
|
||||||
files: string[];
|
files: string[];
|
||||||
|
workdir: string;
|
||||||
targets: string[];
|
targets: string[];
|
||||||
noCache: boolean;
|
noCache: boolean;
|
||||||
pull: boolean;
|
pull: boolean;
|
||||||
@@ -36,6 +37,7 @@ export async function getInputs(): Promise<Inputs> {
|
|||||||
return {
|
return {
|
||||||
builder: core.getInput('builder'),
|
builder: core.getInput('builder'),
|
||||||
files: getInputList('files'),
|
files: getInputList('files'),
|
||||||
|
workdir: core.getInput('workdir') || '.',
|
||||||
targets: getInputList('targets'),
|
targets: getInputList('targets'),
|
||||||
noCache: core.getBooleanInput('no-cache'),
|
noCache: core.getBooleanInput('no-cache'),
|
||||||
pull: core.getBooleanInput('pull'),
|
pull: core.getBooleanInput('pull'),
|
||||||
|
|||||||
@@ -44,11 +44,14 @@ async function run(): Promise<void> {
|
|||||||
const buildCmd = buildx.getCommand(args, standalone);
|
const buildCmd = buildx.getCommand(args, standalone);
|
||||||
|
|
||||||
core.startGroup(`Bake definition`);
|
core.startGroup(`Bake definition`);
|
||||||
await exec.exec(buildCmd.command, [...buildCmd.args, '--print']);
|
await exec.exec(buildCmd.command, [...buildCmd.args, '--print'], {
|
||||||
|
cwd: inputs.workdir
|
||||||
|
});
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
|
|
||||||
await exec
|
await exec
|
||||||
.getExecOutput(buildCmd.command, buildCmd.args, {
|
.getExecOutput(buildCmd.command, buildCmd.args, {
|
||||||
|
cwd: inputs.workdir,
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user