mirror of
https://github.com/docker/build-push-action.git
synced 2025-06-29 15:56:41 +02:00
Add context-subdir input
Adds a `context-subdir` input which gets appended to the context URL. This new input is ignored (with a warning) if the user gives a non-default `context` input such as a path. Signed-off-by: actualben <actualben@users.noreply.github.com>
This commit is contained in:
parent
b1aeb1103e
commit
e946f387af
4 changed files with 62 additions and 2 deletions
12
dist/index.js
generated
vendored
12
dist/index.js
generated
vendored
|
@ -276,6 +276,7 @@ function getInputs(defaultContext) {
|
|||
cacheTo: yield getInputList('cache-to', true),
|
||||
cgroupParent: core.getInput('cgroup-parent'),
|
||||
context: core.getInput('context') || defaultContext,
|
||||
contextSubdir: core.getInput('context-subdir'),
|
||||
file: core.getInput('file'),
|
||||
labels: yield getInputList('labels', true),
|
||||
load: core.getBooleanInput('load'),
|
||||
|
@ -302,7 +303,16 @@ function getArgs(inputs, defaultContext, buildxVersion) {
|
|||
let args = ['buildx'];
|
||||
args.push.apply(args, yield getBuildArgs(inputs, defaultContext, buildxVersion));
|
||||
args.push.apply(args, yield getCommonArgs(inputs, buildxVersion));
|
||||
args.push(inputs.context);
|
||||
let context = inputs.context;
|
||||
if (inputs.contextSubdir) {
|
||||
if (context == defaultContext) {
|
||||
context = `${context}:${inputs.contextSubdir}`;
|
||||
}
|
||||
else {
|
||||
core.warning('"context-subdir" input is ignored when a "context" input is present');
|
||||
}
|
||||
}
|
||||
args.push(context);
|
||||
return args;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue