mirror of
https://git.flexiblyrigid.au/actions/bake-action.git
synced 2025-12-06 15:58:07 +08:00
add allow input
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import {Util} from '@docker/actions-toolkit/lib/util';
|
||||
import {BakeDefinition} from '@docker/actions-toolkit/lib/types/buildx/bake';
|
||||
|
||||
export interface Inputs {
|
||||
allow: string[];
|
||||
builder: string;
|
||||
files: string[];
|
||||
workdir: string;
|
||||
@@ -28,6 +29,7 @@ export interface Inputs {
|
||||
|
||||
export async function getInputs(): Promise<Inputs> {
|
||||
return {
|
||||
allow: Util.getInputList('allow'),
|
||||
builder: core.getInput('builder'),
|
||||
files: Util.getInputList('files'),
|
||||
workdir: core.getInput('workdir') || '.',
|
||||
@@ -80,6 +82,11 @@ async function getBakeArgs(inputs: Inputs, definition: BakeDefinition, toolkit:
|
||||
if (inputs.source) {
|
||||
args.push(inputs.source);
|
||||
}
|
||||
if (await toolkit.buildx.versionSatisfies('>=0.17.0')) {
|
||||
if (inputs.allow.length > 0) {
|
||||
args.push('--allow', inputs.allow.join(','));
|
||||
}
|
||||
}
|
||||
await Util.asyncForEach(inputs.files, async file => {
|
||||
args.push('--file', file);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user