Skip to content

Commit

Permalink
Add allow input
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
CrazyMax committed Aug 16, 2020
1 parent 78a1e0d commit 01bd5c1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ./
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/context-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface Inputs {
tags: string[];
pull: boolean;
target: string;
allow: string;
noCache: boolean;
builder: string;
platforms: string;
Expand All @@ -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'),
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand Down

0 comments on commit 01bd5c1

Please sign in to comment.