Skip to content

Commit

Permalink
fix(service): extract the label part from what is returned by the met…
Browse files Browse the repository at this point in the history
…adata action

Signed-off-by: Sven Trieflinger <[email protected]>
  • Loading branch information
strieflin committed Jul 28, 2023
1 parent 74dd655 commit 74bf80a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/service.publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,20 @@ jobs:
uses: imjasonh/[email protected]
- name: Publish Docker Images
run: |
# Generate tags flag
# Generate tags flag (Metadata action output is newline delimited entries like
# 'ghcr.io/carbynestack/ephemeral:0.1.10' and we only need the part after the colon)
readarray -t tags < <( echo "${{ steps.meta.outputs.tags }}" )
for i in "${!tags[@]}"; do
readarray -d ":" -t parts < <( echo "${tags[i]}" )
tags[i]=$(echo "${parts[1]}" | tr -d '\n')
done
printf -v joined_tags "%s," "${tags[@]}"
# Generate label flags
readarray -t labels < <( echo "${{ steps.meta.outputs.labels }}" )
printf -v label_flags -- "--image-label=%s " "${labels[@]}"
# Publish using ko
ko publish -B \
--tags="${joined_tags%,}" \
"${label_flags}" \
Expand Down

0 comments on commit 74bf80a

Please sign in to comment.