Skip to content

Commit f6a7333

Browse files
committed
Sort inputs
Signed-off-by: CrazyMax <[email protected]>
1 parent eb4f146 commit f6a7333

File tree

4 files changed

+69
-69
lines changed

4 files changed

+69
-69
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,25 +195,25 @@ Following inputs can be used as `step.with` keys
195195

196196
| Name | Type | Description |
197197
|---------------------|----------|------------------------------------|
198+
| `allow` | List/CSV | List of [extra privileged entitlement](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#allow) (eg. `network.host,security.insecure`) |
198199
| `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) |
200+
| `build-args` | List | List of build-time variables |
201+
| `cache-from` | List | List of [external cache sources](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#cache-from) (eg. `type=local,src=path/to/dir`) |
202+
| `cache-to` | List | List of [cache export destinations](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#cache-to) (eg. `type=local,dest=path/to/dir`) |
199203
| `context` | String | Build's context is the set of files located in the specified [`PATH` or `URL`](https://docs.docker.com/engine/reference/commandline/build/) (default [Git context](#git-context)) |
200204
| `file` | String | Path to the Dockerfile. (default `{context}/Dockerfile`) |
201-
| `build-args` | List | List of build-time variables |
202205
| `labels` | List | List of metadata for an image |
203-
| `tags` | List/CSV | List of tags |
204-
| `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) |
205-
| `target` | String | Sets the target stage to build |
206-
| `allow` | List/CSV | List of [extra privileged entitlement](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#allow) (eg. `network.host,security.insecure`) |
206+
| `load` | Bool | [Load](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#load) is a shorthand for `--output=type=docker` (default `false`) |
207207
| `no-cache` | Bool | Do not use cache when building the image (default `false`) |
208+
| `outputs` | List | List of [output destinations](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#output) (format: `type=local,dest=path`) |
208209
| `platforms` | List/CSV | List of [target platforms](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#platform) for build |
209-
| `load` | Bool | [Load](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#load) is a shorthand for `--output=type=docker` (default `false`) |
210+
| `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) |
210211
| `push` | Bool | [Push](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#push) is a shorthand for `--output=type=registry` (default `false`) |
211-
| `outputs` | List | List of [output destinations](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#output) (format: `type=local,dest=path`) |
212-
| `cache-from` | List | List of [external cache sources](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#cache-from) (eg. `type=local,src=path/to/dir`) |
213-
| `cache-to` | List | List of [cache export destinations](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#cache-to) (eg. `type=local,dest=path/to/dir`) |
214212
| `secrets` | List | List of secrets to expose to the build (eg. `key=string`, `GIT_AUTH_TOKEN=mytoken`) |
215213
| `secret-files` | List | List of secret files to expose to the build (eg. `key=filename`, `MY_SECRET=./secret.txt`) |
216214
| `ssh` | List | List of SSH agent socket or keys to expose to the build |
215+
| `tags` | List/CSV | List of tags |
216+
| `target` | String | Sets the target stage to build |
217217

218218
### outputs
219219

action.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,58 +7,52 @@ branding:
77
color: 'blue'
88

99
inputs:
10+
allow:
11+
description: "List of extra privileged entitlement (eg. network.host,security.insecure)"
12+
required: false
13+
build-args:
14+
description: "List of build-time variables"
15+
required: false
1016
builder:
1117
description: "Builder instance"
1218
required: false
19+
cache-from:
20+
description: "List of external cache sources for buildx (eg. user/app:cache, type=local,src=path/to/dir)"
21+
required: false
22+
cache-to:
23+
description: "List of cache export destinations for buildx (eg. user/app:cache, type=local,dest=path/to/dir)"
24+
required: false
1325
context:
1426
description: "Build's context is the set of files located in the specified PATH or URL"
1527
required: false
1628
file:
1729
description: "Path to the Dockerfile"
1830
required: false
19-
build-args:
20-
description: "List of build-time variables"
21-
required: false
2231
labels:
2332
description: "List of metadata for an image"
2433
required: false
25-
tags:
26-
description: "List of tags"
27-
required: false
28-
pull:
29-
description: "Always attempt to pull a newer version of the image"
34+
load:
35+
description: "Load is a shorthand for --output=type=docker"
3036
required: false
3137
default: 'false'
32-
target:
33-
description: "Sets the target stage to build"
34-
required: false
35-
allow:
36-
description: "List of extra privileged entitlement (eg. network.host,security.insecure)"
37-
required: false
3838
no-cache:
3939
description: "Do not use cache when building the image"
4040
required: false
4141
default: 'false'
42+
outputs:
43+
description: "List of output destinations (format: type=local,dest=path)"
44+
required: false
4245
platforms:
4346
description: "List of target platforms for build"
4447
required: false
45-
load:
46-
description: "Load is a shorthand for --output=type=docker"
48+
pull:
49+
description: "Always attempt to pull a newer version of the image"
4750
required: false
4851
default: 'false'
4952
push:
5053
description: "Push is a shorthand for --output=type=registry"
5154
required: false
5255
default: 'false'
53-
outputs:
54-
description: "List of output destinations (format: type=local,dest=path)"
55-
required: false
56-
cache-from:
57-
description: "List of external cache sources for buildx (eg. user/app:cache, type=local,src=path/to/dir)"
58-
required: false
59-
cache-to:
60-
description: "List of cache export destinations for buildx (eg. user/app:cache, type=local,dest=path/to/dir)"
61-
required: false
6256
secrets:
6357
description: "List of secrets to expose to the build (eg. key=string, GIT_AUTH_TOKEN=mytoken)"
6458
required: false
@@ -68,6 +62,12 @@ inputs:
6862
ssh:
6963
description: "List of SSH agent socket or keys to expose to the build"
7064
required: false
65+
tags:
66+
description: "List of tags"
67+
required: false
68+
target:
69+
description: "Sets the target stage to build"
70+
required: false
7171
github-token:
7272
description: "GitHub Token used to authenticate against a repository for Git context"
7373
default: ${{ github.token }}

dist/index.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ import * as buildx from './buildx';
1313
let _defaultContext, _tmpDir: string;
1414

1515
export interface Inputs {
16+
allow: string[];
17+
buildArgs: string[];
18+
builder: string;
19+
cacheFrom: string[];
20+
cacheTo: string[];
1621
context: string;
1722
file: string;
18-
buildArgs: string[];
1923
labels: string[];
20-
tags: string[];
21-
pull: boolean;
22-
target: string;
23-
allow: string[];
24+
load: boolean;
2425
noCache: boolean;
25-
builder: string;
26+
outputs: string[];
2627
platforms: string[];
27-
load: boolean;
28+
pull: boolean;
2829
push: boolean;
29-
outputs: string[];
30-
cacheFrom: string[];
31-
cacheTo: string[];
3230
secrets: string[];
3331
secretFiles: string[];
34-
githubToken: string;
3532
ssh: string[];
33+
tags: string[];
34+
target: string;
35+
githubToken: string;
3636
}
3737

3838
export function defaultContext(): string {
@@ -57,26 +57,26 @@ export function tmpNameSync(options?: tmp.TmpNameOptions): string {
5757

5858
export async function getInputs(defaultContext: string): Promise<Inputs> {
5959
return {
60+
allow: await getInputList('allow'),
61+
buildArgs: await getInputList('build-args', true),
62+
builder: core.getInput('builder'),
63+
cacheFrom: await getInputList('cache-from', true),
64+
cacheTo: await getInputList('cache-to', true),
6065
context: core.getInput('context') || defaultContext,
6166
file: core.getInput('file'),
62-
buildArgs: await getInputList('build-args', true),
6367
labels: await getInputList('labels', true),
64-
tags: await getInputList('tags'),
65-
pull: /true/i.test(core.getInput('pull')),
66-
target: core.getInput('target'),
67-
allow: await getInputList('allow'),
68+
load: /true/i.test(core.getInput('load')),
6869
noCache: /true/i.test(core.getInput('no-cache')),
69-
builder: core.getInput('builder'),
70+
outputs: await getInputList('outputs', true),
7071
platforms: await getInputList('platforms'),
71-
load: /true/i.test(core.getInput('load')),
72+
pull: /true/i.test(core.getInput('pull')),
7273
push: /true/i.test(core.getInput('push')),
73-
outputs: await getInputList('outputs', true),
74-
cacheFrom: await getInputList('cache-from', true),
75-
cacheTo: await getInputList('cache-to', true),
7674
secrets: await getInputList('secrets', true),
7775
secretFiles: await getInputList('secret-files', true),
78-
githubToken: core.getInput('github-token'),
79-
ssh: await getInputList('ssh')
76+
ssh: await getInputList('ssh'),
77+
tags: await getInputList('tags'),
78+
target: core.getInput('target'),
79+
githubToken: core.getInput('github-token')
8080
};
8181
}
8282

0 commit comments

Comments
 (0)