Skip to content

Commit e3c41b6

Browse files
committed
fix: addressed comments from @NickLarsenNZ
1 parent ea90853 commit e3c41b6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

publish-image/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ runs:
110110
DIGEST=${IMAGE_REPO_DIGEST#*@}
111111
112112
# URL encode the digest and image repository, needed for the purl
113-
URLENCODED_DIGEST=$(echo "$DIGEST" | jq -Rr @uri)
114-
URLENCODED_IMAGE_REPOSITORY=$(echo "$IMAGE_REPOSITORY" | jq -Rr @uri)
113+
URLENCODED_DIGEST=$(jq -rn --arg input "$DIGEST" '$input | @uri')
114+
URLENCODED_IMAGE_REPOSITORY=$(jq -rn --arg input "$IMAGE_REPOSITORY" '$input | @uri')
115115
# Last item, split by /
116116
# Example: sdp/kafka -> kafka
117117
SOURCE_NAME=$(echo "$IMAGE_REPOSITORY" | awk -F'/' '{print $NF}')
@@ -122,7 +122,7 @@ runs:
122122
exit 1
123123
fi
124124
# Construct the package url (purl)
125-
PURL="pkg:oci/$SOURCE_NAME@$URLENCODED_DIGEST?arch=${ARCH}&repository_url=${REGISTRY_URI}%2F${URLENCODED_IMAGE_REPOSITORY}"
125+
PURL="pkg:oci/{$SOURCE_NAME}@{$URLENCODED_DIGEST}?arch=${ARCH}&repository_url=${REGISTRY_URI}%2F${URLENCODED_IMAGE_REPOSITORY}"
126126
127127
# Get metadata from the image
128128
# NOTE (@Techassi): Maybe we should run this command only once

0 commit comments

Comments
 (0)