Add working-directory option

Signed-off-by: Danilo Tuler <tuler@pobox.com>
This commit is contained in:
Danilo Tuler
2022-07-08 08:53:34 -04:00
parent c7fa0af149
commit e917a42053
6 changed files with 14 additions and 4 deletions

View File

@@ -12,6 +12,7 @@ let _tmpDir: string;
export interface Inputs {
builder: string;
files: string[];
workdir: string;
targets: string[];
noCache: boolean;
pull: boolean;
@@ -36,6 +37,7 @@ export async function getInputs(): Promise<Inputs> {
return {
builder: core.getInput('builder'),
files: getInputList('files'),
workdir: core.getInput('workdir') || '.',
targets: getInputList('targets'),
noCache: core.getBooleanInput('no-cache'),
pull: core.getBooleanInput('pull'),

View File

@@ -44,11 +44,14 @@ async function run(): Promise<void> {
const buildCmd = buildx.getCommand(args, standalone);
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();
await exec
.getExecOutput(buildCmd.command, buildCmd.args, {
cwd: inputs.workdir,
ignoreReturnCode: true
})
.then(res => {