Add allow input

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-08-16 07:07:06 +02:00
parent 78a1e0d9a3
commit 01bd5c1fa9
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
6 changed files with 17 additions and 0 deletions

View file

@ -37,6 +37,9 @@ jobs:
name: Set up Docker Buildx
id: buildx
uses: ./setup-buildx/ # change to docker/setup-buildx-action@master
# with:
# driver-opt: network=host
# buildkitd-flags:
-
name: Build and push
uses: ./
@ -45,6 +48,7 @@ jobs:
file: ./test/Dockerfile-${{ matrix.dockerfile }}
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64,linux/386
allow: network.host,security.insecure
#push: true
tags: |
localhost:5000/name/app:latest

View file

@ -82,6 +82,7 @@ Following inputs can be used as `step.with` keys
| `tags` | String | | Newline-delimited list of tags **required** |
| `pull` | Bool | `false` | Always attempt to pull a newer version of the image |
| `target` | String | | Sets the target stage to build |
| `allow` | String | | Allow extra privileged entitlement (eg. network.host,security.insecure) |
| `no-cache` | Bool | `false` | Do not use cache when building the image |
| `platforms` | String | | Comma-delimited list of target platforms for build |
| `load` | Bool | `false` | Shorthand for `--output=type=docker` |

View file

@ -33,6 +33,9 @@ inputs:
target:
description: "Sets the target stage to build"
required: false
allow:
description: "Allow extra privileged entitlement (eg. network.host,security.insecure)"
required: false
no-cache:
description: "Do not use cache when building the image"
required: false

4
dist/index.js generated vendored
View file

@ -1041,6 +1041,9 @@ function run() {
if (inputs.target) {
buildArgs.push('--target', inputs.target);
}
if (inputs.allow) {
buildArgs.push('--allow', inputs.allow);
}
if (inputs.noCache) {
buildArgs.push('--no-cache');
}
@ -1127,6 +1130,7 @@ function loadInputs() {
tags: yield getInputList('tags'),
pull: /true/i.test(core.getInput('pull')),
target: core.getInput('target'),
allow: core.getInput('allow'),
noCache: /true/i.test(core.getInput('no-cache')),
builder: core.getInput('builder'),
platforms: core.getInput('platforms'),

View file

@ -8,6 +8,7 @@ export interface Inputs {
tags: string[];
pull: boolean;
target: string;
allow: string;
noCache: boolean;
builder: string;
platforms: string;
@ -27,6 +28,7 @@ export async function loadInputs(): Promise<Inputs> {
tags: await getInputList('tags'),
pull: /true/i.test(core.getInput('pull')),
target: core.getInput('target'),
allow: core.getInput('allow'),
noCache: /true/i.test(core.getInput('no-cache')),
builder: core.getInput('builder'),
platforms: core.getInput('platforms'),

View file

@ -42,6 +42,9 @@ async function run(): Promise<void> {
if (inputs.target) {
buildArgs.push('--target', inputs.target);
}
if (inputs.allow) {
buildArgs.push('--allow', inputs.allow);
}
if (inputs.noCache) {
buildArgs.push('--no-cache');
}