Add image-url to the output of the action.

Added Complete URL to the Output of the action.
Such that other steps can use the URL for further operations
also, Modified README based on the changes.

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
divyansh42 2020-11-19 13:55:55 +05:30
parent e91c7f612e
commit 9bf729da5c
5 changed files with 13 additions and 2 deletions

View file

@ -55,6 +55,12 @@ Push-to-registry is a GitHub Action for pushing an OCI-compatible image to an im
</tr> </tr>
</table> </table>
## Action Outputs
This action produces these outputs which can be used for further processing in different Github action:
**image-url**: Contains complete URL of the image which is pushed using this action. (e.g. `quay.io/username/spring-image:v1`)
## Examples ## Examples
The example below shows how the `push-to-registry` action can be used to push an image created by the [`buildah-action`](https://github.com/redhat-actions/buildah-action) in an early step. The example below shows how the `push-to-registry` action can be used to push an image created by the [`buildah-action`](https://github.com/redhat-actions/buildah-action) in an early step.

View file

@ -21,6 +21,9 @@ inputs:
password: password:
description: 'Password to use as credential to authenticate to the registry' description: 'Password to use as credential to authenticate to the registry'
required: true required: true
outputs:
image-url:
description: 'Complete URL of the pushed image'
runs: runs:
using: 'node12' using: 'node12'
main: 'dist/index.js' main: 'dist/index.js'

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

@ -40,6 +40,8 @@ export async function run(): Promise<void> {
return Promise.reject(new Error(push.reason)); return Promise.reject(new Error(push.reason));
} }
core.info(`Successfully pushed ${imageToPush} to ${registryUrl}.`); core.info(`Successfully pushed ${imageToPush} to ${registryUrl}.`);
core.setOutput('image-url', registryUrl);
} }
async function execute(executable: string, args: string[]): Promise<CommandResult> { async function execute(executable: string, args: string[]): Promise<CommandResult> {