Add output image-with-tag (#68)

* Add output image-with-tag

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
Divyanshu Agrawal 2021-09-13 20:34:36 +05:30 committed by GitHub
parent fe5edd5859
commit ab006ef445
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 2 deletions

View file

@ -58,6 +58,7 @@ jobs:
run: |
echo "Image: ${{ steps.build_image.outputs.image }}"
echo "Tags: ${{ steps.build_image.outputs.tags }}"
echo "Tagged Image: ${{ steps.build_image.outputs.image-with-tag }}"
# Check if image is build
- name: Check images created

View file

@ -65,6 +65,7 @@ jobs:
run: |
echo "Image: ${{ steps.build_image.outputs.image }}"
echo "Tags: ${{ steps.build_image.outputs.tags }}"
echo "Tagged Image: ${{ steps.build_image.outputs.image-with-tag }}"
- name: Check images created
run: buildah images | grep '${{ env.IMAGE_NAME }}'

View file

@ -101,6 +101,7 @@ jobs:
run: |
echo "Image: ${{ steps.build_image.outputs.image }}"
echo "Tags: ${{ steps.build_image.outputs.tags }}"
echo "Tagged Image: ${{ steps.build_image.outputs.image-with-tag }}"
# Check if image is build
- name: Check images created

View file

@ -62,6 +62,9 @@ For example, `spring-image`.
`tags`: A list of the tags that were created, separated by spaces.<br>
For example, `latest ${{ github.sha }}`.
`image-with-tag`: The name of the image tagged with the first tag present.<br>
For example, `spring-image:latest`
<a id="build-types"></a>
## Build Types

View file

@ -63,6 +63,8 @@ outputs:
description: 'Name of the image built'
tags:
description: 'List of the tags that were created, separated by spaces'
image-with-tag:
description: 'Name of the image tagged with the first tag present'
runs:
using: 'node12'
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

@ -106,6 +106,12 @@ export enum Outputs {
* Default: None.
*/
IMAGE = "image",
/**
* Name of the image tagged with the first tag present
* Required: false
* Default: None.
*/
IMAGE_WITH_TAG = "image-with-tag",
/**
* List of the tags that were created, separated by spaces
* Required: false

View file

@ -54,6 +54,7 @@ export async function run(): Promise<void> {
}
core.setOutput(Outputs.IMAGE, image);
core.setOutput(Outputs.TAGS, tags);
core.setOutput(Outputs.IMAGE_WITH_TAG, `${image}:${tagsList[0]}`);
}
async function doBuildUsingDockerFiles(