File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,13 @@ runs:
110
110
DIGEST=${IMAGE_REPO_DIGEST#*@}
111
111
112
112
# Construct the package url (purl)
113
- # TODO (@Techassi): Can we use 'oci' instead of 'docker' as the type?
114
- PURL="pkg:docker/$IMAGE_REPOSITORY@$DIGEST?repository_url=$REGISTRY_URI"
113
+ URLENCODED_DIGEST=$(echo "$DIGEST" | sed 's/:/%3A/g')
114
+ URLENCODED_IMAGE_REPOSITORY=$(echo "$IMAGE_REPOSITORY" | sed 's/\//%2F/g')
115
+ # Last item, split by /
116
+ IMAGE_NAME=$(echo "$IMAGE_REPOSITORY" | awk -F'/' '{print $NF}')
117
+ # Obtain architecture from container image
118
+ ARCH=$(docker inspect --format='{{index .Os}}/{{index .Architecture}}' "${IMAGE_REPO_DIGEST}" | cut -d'/' -f2)
119
+ PURL="pkg:oci/$IMAGE_NAME@$URLENCODED_DIGEST?arch=${ARCH}&repository_url=${REGISTRY_URI}%2F${URLENCODED_IMAGE_REPOSITORY}"
115
120
116
121
# Get metadata from the image
117
122
# NOTE (@Techassi): Maybe we should run this command only once
You can’t perform that action at this time.
0 commit comments