Add back singular registry-path output

Fixes #29

Signed-off-by: Tim Etchells <tetchell@redhat.com>
This commit is contained in:
Tim Etchells 2021-02-21 16:41:27 -05:00 committed by Divyanshu Agrawal
parent 902794f5ab
commit 24d8460d9f
6 changed files with 19 additions and 8 deletions

View file

@ -86,13 +86,15 @@ Refer to the [`podman push`](http://docs.podman.io/en/latest/markdown/podman-man
## Action Outputs ## Action Outputs
`registry-paths`: A JSON array of registry paths to which the tag(s) were pushed.<br>
For example, `[ quay.io/username/spring-image:v1, quay.io/username/spring-image:latest ]`.
`digest`: The pushed image digest, as written to the `digestfile`.<br> `digest`: The pushed image digest, as written to the `digestfile`.<br>
For example, `sha256:66ce924069ec4181725d15aa27f34afbaf082f434f448dc07a42daa3305cdab3`. For example, `sha256:66ce924069ec4181725d15aa27f34afbaf082f434f448dc07a42daa3305cdab3`.
For multiple tags, the digest is the same. For multiple tags, the digest is the same.
`registry-paths`: A JSON array of registry paths to which the tag(s) were pushed.<br>
For example, `[ quay.io/username/spring-image:v1, quay.io/username/spring-image:latest ]`.
`registry-path`: The first element of `registry-paths`, as a string.
## Examples ## Examples
The example below shows how the `push-to-registry` action can be used to push an image created by the [buildah-build](https://github.com/redhat-actions/buildah-build) action. The example below shows how the `push-to-registry` action can be used to push an image created by the [buildah-build](https://github.com/redhat-actions/buildah-build) action.

View file

@ -40,6 +40,8 @@ inputs:
outputs: outputs:
digest: digest:
description: 'The pushed image digest, as written to the "digestfile"' description: 'The pushed image digest, as written to the "digestfile"'
registry-path:
description: 'The first element of registry-paths.'
registry-paths: registry-paths:
description: 'A JSON array of registry paths to which the tag(s) were pushed' description: 'A JSON array of registry paths to which the tag(s) were pushed'
runs: runs:

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View file

@ -60,6 +60,12 @@ export enum Outputs {
* Default: None. * Default: None.
*/ */
DIGEST = "digest", DIGEST = "digest",
/**
* The first element of registry-paths.
* Required: false
* Default: None.
*/
REGISTRY_PATH = "registry-path",
/** /**
* A JSON array of registry paths to which the tag(s) were pushed * A JSON array of registry paths to which the tag(s) were pushed
* Required: false * Required: false

View file

@ -197,6 +197,7 @@ async function run(): Promise<void> {
} }
} }
core.setOutput(Outputs.REGISTRY_PATH, registryPathList[0]);
core.setOutput(Outputs.REGISTRY_PATHS, JSON.stringify(registryPathList)); core.setOutput(Outputs.REGISTRY_PATHS, JSON.stringify(registryPathList));
} }