From f6a733366afee49bb9909f9149c83caf6bcca87b Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 6 Apr 2021 13:54:58 +0200 Subject: [PATCH] Sort inputs Signed-off-by: CrazyMax --- README.md | 18 +++++++++--------- action.yml | 50 +++++++++++++++++++++++++------------------------- dist/index.js | 24 ++++++++++++------------ src/context.ts | 46 +++++++++++++++++++++++----------------------- 4 files changed, 69 insertions(+), 69 deletions(-) diff --git a/README.md b/README.md index 6601b8c3e..6358d5314 100644 --- a/README.md +++ b/README.md @@ -195,25 +195,25 @@ Following inputs can be used as `step.with` keys | Name | Type | Description | |---------------------|----------|------------------------------------| +| `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`) | | `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) | +| `build-args` | List | List of build-time variables | +| `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`) | +| `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`) | | `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)) | | `file` | String | Path to the Dockerfile. (default `{context}/Dockerfile`) | -| `build-args` | List | List of build-time variables | | `labels` | List | List of metadata for an image | -| `tags` | List/CSV | List of tags | -| `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) | -| `target` | String | Sets the target stage to build | -| `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`) | +| `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`) | | `no-cache` | Bool | Do not use cache when building the image (default `false`) | +| `outputs` | List | List of [output destinations](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#output) (format: `type=local,dest=path`) | | `platforms` | List/CSV | List of [target platforms](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#platform) for build | -| `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`) | +| `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) | | `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`) | -| `outputs` | List | List of [output destinations](https://github.com/docker/buildx/blob/master/docs/reference/buildx_build.md#output) (format: `type=local,dest=path`) | -| `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`) | -| `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`) | | `secrets` | List | List of secrets to expose to the build (eg. `key=string`, `GIT_AUTH_TOKEN=mytoken`) | | `secret-files` | List | List of secret files to expose to the build (eg. `key=filename`, `MY_SECRET=./secret.txt`) | | `ssh` | List | List of SSH agent socket or keys to expose to the build | +| `tags` | List/CSV | List of tags | +| `target` | String | Sets the target stage to build | ### outputs diff --git a/action.yml b/action.yml index 1e9608a6d..77b26aa7e 100644 --- a/action.yml +++ b/action.yml @@ -7,58 +7,52 @@ branding: color: 'blue' inputs: + allow: + description: "List of extra privileged entitlement (eg. network.host,security.insecure)" + required: false + build-args: + description: "List of build-time variables" + required: false builder: description: "Builder instance" required: false + cache-from: + description: "List of external cache sources for buildx (eg. user/app:cache, type=local,src=path/to/dir)" + required: false + cache-to: + description: "List of cache export destinations for buildx (eg. user/app:cache, type=local,dest=path/to/dir)" + required: false context: description: "Build's context is the set of files located in the specified PATH or URL" required: false file: description: "Path to the Dockerfile" required: false - build-args: - description: "List of build-time variables" - required: false labels: description: "List of metadata for an image" required: false - tags: - description: "List of tags" - required: false - pull: - description: "Always attempt to pull a newer version of the image" + load: + description: "Load is a shorthand for --output=type=docker" required: false default: 'false' - target: - description: "Sets the target stage to build" - required: false - allow: - description: "List of extra privileged entitlement (eg. network.host,security.insecure)" - required: false no-cache: description: "Do not use cache when building the image" required: false default: 'false' + outputs: + description: "List of output destinations (format: type=local,dest=path)" + required: false platforms: description: "List of target platforms for build" required: false - load: - description: "Load is a shorthand for --output=type=docker" + pull: + description: "Always attempt to pull a newer version of the image" required: false default: 'false' push: description: "Push is a shorthand for --output=type=registry" required: false default: 'false' - outputs: - description: "List of output destinations (format: type=local,dest=path)" - required: false - cache-from: - description: "List of external cache sources for buildx (eg. user/app:cache, type=local,src=path/to/dir)" - required: false - cache-to: - description: "List of cache export destinations for buildx (eg. user/app:cache, type=local,dest=path/to/dir)" - required: false secrets: description: "List of secrets to expose to the build (eg. key=string, GIT_AUTH_TOKEN=mytoken)" required: false @@ -68,6 +62,12 @@ inputs: ssh: description: "List of SSH agent socket or keys to expose to the build" required: false + tags: + description: "List of tags" + required: false + target: + description: "Sets the target stage to build" + required: false github-token: description: "GitHub Token used to authenticate against a repository for Git context" default: ${{ github.token }} diff --git a/dist/index.js b/dist/index.js index 989e3fff3..aee4be142 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13033,26 +13033,26 @@ exports.tmpNameSync = tmpNameSync; function getInputs(defaultContext) { return __awaiter(this, void 0, void 0, function* () { return { + allow: yield getInputList('allow'), + buildArgs: yield getInputList('build-args', true), + builder: core.getInput('builder'), + cacheFrom: yield getInputList('cache-from', true), + cacheTo: yield getInputList('cache-to', true), context: core.getInput('context') || defaultContext, file: core.getInput('file'), - buildArgs: yield getInputList('build-args', true), labels: yield getInputList('labels', true), - tags: yield getInputList('tags'), - pull: /true/i.test(core.getInput('pull')), - target: core.getInput('target'), - allow: yield getInputList('allow'), + load: /true/i.test(core.getInput('load')), noCache: /true/i.test(core.getInput('no-cache')), - builder: core.getInput('builder'), + outputs: yield getInputList('outputs', true), platforms: yield getInputList('platforms'), - load: /true/i.test(core.getInput('load')), + pull: /true/i.test(core.getInput('pull')), push: /true/i.test(core.getInput('push')), - outputs: yield getInputList('outputs', true), - cacheFrom: yield getInputList('cache-from', true), - cacheTo: yield getInputList('cache-to', true), secrets: yield getInputList('secrets', true), secretFiles: yield getInputList('secret-files', true), - githubToken: core.getInput('github-token'), - ssh: yield getInputList('ssh') + ssh: yield getInputList('ssh'), + tags: yield getInputList('tags'), + target: core.getInput('target'), + githubToken: core.getInput('github-token') }; }); } diff --git a/src/context.ts b/src/context.ts index 35df65a36..922c430fb 100644 --- a/src/context.ts +++ b/src/context.ts @@ -13,26 +13,26 @@ import * as buildx from './buildx'; let _defaultContext, _tmpDir: string; export interface Inputs { + allow: string[]; + buildArgs: string[]; + builder: string; + cacheFrom: string[]; + cacheTo: string[]; context: string; file: string; - buildArgs: string[]; labels: string[]; - tags: string[]; - pull: boolean; - target: string; - allow: string[]; + load: boolean; noCache: boolean; - builder: string; + outputs: string[]; platforms: string[]; - load: boolean; + pull: boolean; push: boolean; - outputs: string[]; - cacheFrom: string[]; - cacheTo: string[]; secrets: string[]; secretFiles: string[]; - githubToken: string; ssh: string[]; + tags: string[]; + target: string; + githubToken: string; } export function defaultContext(): string { @@ -57,26 +57,26 @@ export function tmpNameSync(options?: tmp.TmpNameOptions): string { export async function getInputs(defaultContext: string): Promise { return { + allow: await getInputList('allow'), + buildArgs: await getInputList('build-args', true), + builder: core.getInput('builder'), + cacheFrom: await getInputList('cache-from', true), + cacheTo: await getInputList('cache-to', true), context: core.getInput('context') || defaultContext, file: core.getInput('file'), - buildArgs: await getInputList('build-args', true), labels: await getInputList('labels', true), - tags: await getInputList('tags'), - pull: /true/i.test(core.getInput('pull')), - target: core.getInput('target'), - allow: await getInputList('allow'), + load: /true/i.test(core.getInput('load')), noCache: /true/i.test(core.getInput('no-cache')), - builder: core.getInput('builder'), + outputs: await getInputList('outputs', true), platforms: await getInputList('platforms'), - load: /true/i.test(core.getInput('load')), + pull: /true/i.test(core.getInput('pull')), push: /true/i.test(core.getInput('push')), - outputs: await getInputList('outputs', true), - cacheFrom: await getInputList('cache-from', true), - cacheTo: await getInputList('cache-to', true), secrets: await getInputList('secrets', true), secretFiles: await getInputList('secret-files', true), - githubToken: core.getInput('github-token'), - ssh: await getInputList('ssh') + ssh: await getInputList('ssh'), + tags: await getInputList('tags'), + target: core.getInput('target'), + githubToken: core.getInput('github-token') }; }