mirror of
https://github.com/ditkrg/build-image-workflow.git
synced 2026-01-23 04:16:58 +00:00
Update action.yml with new tag value and add JSON parsing
Signed-off-by: Shakar Bakr <5h4k4r.b4kr@gmail.com>
This commit is contained in:
parent
51293f0a01
commit
ae829aefaa
12
action.yml
12
action.yml
@ -28,7 +28,7 @@ inputs:
|
|||||||
outputs:
|
outputs:
|
||||||
tag:
|
tag:
|
||||||
description: "Image Tag"
|
description: "Image Tag"
|
||||||
value: ${{ env.tag }}
|
value: ${{ steps.set_tag.outputs.tag }}
|
||||||
tags:
|
tags:
|
||||||
description: "Image Tags"
|
description: "Image Tags"
|
||||||
value: ${{ steps.meta.outputs.tags }}
|
value: ${{ steps.meta.outputs.tags }}
|
||||||
@ -81,7 +81,9 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
# Define an array of strings
|
# Define an array of strings
|
||||||
my_array=$tags
|
my_array=reg.dev.krd/dms/client:dev-cb54d82
|
||||||
|
reg.dev.krd/dms/client:dev
|
||||||
|
reg.dev.krd/dms/client:dev-cache
|
||||||
|
|
||||||
# Specify the index you want to extract
|
# Specify the index you want to extract
|
||||||
index_to_extract=0
|
index_to_extract=0
|
||||||
@ -90,8 +92,10 @@ runs:
|
|||||||
extracted_element="${my_array[$index_to_extract]}"
|
extracted_element="${my_array[$index_to_extract]}"
|
||||||
|
|
||||||
echo "Extracted element: $extracted_element"
|
echo "Extracted element: $extracted_element"
|
||||||
|
fromJson = $(echo "$json" | jq -r '.tags | [.] | .[0]')
|
||||||
|
echo "fromJson=$fromJson"
|
||||||
|
|
||||||
|
echo "tag=$extracted_element" >> $GITHUB_OUTPUT
|
||||||
echo "tag=$extracted_element" >> $GITHUB_ENV
|
|
||||||
env:
|
env:
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
json: ${{ steps.meta.outputs.json }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user