Skip to content

Commit ec4d5b9

Browse files
authored
Merge pull request #14 from ditkrg/dev
Fix empty tag output
2 parents 2ae1358 + 8282681 commit ec4d5b9

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

action.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ inputs:
2828
outputs:
2929
tag:
3030
description: "Image Tag"
31-
value: ${{ steps.meta.outputs.tags[0] }}
31+
value: ${{ steps.set_tag.outputs.tag }}
3232
tags:
3333
description: "Image Tags"
3434
value: ${{ steps.meta.outputs.tags }}
@@ -75,3 +75,15 @@ runs:
7575
cache-from: type=registry,ref=${{ inputs.registry }}/${{ inputs.image }}:${{ github.ref_name }}-cache
7676
build-args: ${{ inputs.build-args }}
7777
secrets: ${{ inputs.build-secrets }}
78+
79+
- name: Set Tag
80+
id: set_tag
81+
shell: bash
82+
run: |
83+
84+
extracted_tag=$(echo "$json" | jq -r '.tags | .[0]')
85+
echo "tag=$extracted_tag" >> $GITHUB_OUTPUT
86+
87+
env:
88+
tags: ${{ steps.meta.outputs.tags }}
89+
json: ${{ steps.meta.outputs.json }}

0 commit comments

Comments
 (0)