Bot Updating Templated Files
This commit is contained in:
31
.github/workflows/external_trigger.yml
vendored
31
.github/workflows/external_trigger.yml
vendored
@@ -48,13 +48,30 @@ jobs:
|
|||||||
--header "Accept: application/vnd.oci.image.index.v1+json" \
|
--header "Accept: application/vnd.oci.image.index.v1+json" \
|
||||||
--header "Authorization: Bearer ${token}" \
|
--header "Authorization: Bearer ${token}" \
|
||||||
"https://ghcr.io/v2/${image}/manifests/${tag}")
|
"https://ghcr.io/v2/${image}/manifests/${tag}")
|
||||||
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
|
if jq -e '.layers // empty' <<< "${multidigest}" >/dev/null 2>&1; then
|
||||||
digest=$(curl -s \
|
# If there's a layer element it's a single-arch manifest so just get that digest
|
||||||
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
|
digest=$(jq -r '.config.digest' <<< "${multidigest}")
|
||||||
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
|
else
|
||||||
--header "Authorization: Bearer ${token}" \
|
# Otherwise it's multi-arch or has manifest annotations
|
||||||
"https://ghcr.io/v2/${image}/manifests/${multidigest}" \
|
if jq -e '.manifests[]?.annotations // empty' <<< "${multidigest}" >/dev/null 2>&1; then
|
||||||
| jq -r '.config.digest')
|
# Check for manifest annotations and delete if found
|
||||||
|
multidigest=$(jq 'del(.manifests[] | select(.annotations))' <<< "${multidigest}")
|
||||||
|
fi
|
||||||
|
if [[ $(jq '.manifests | length' <<< "${multidigest}") -gt 1 ]]; then
|
||||||
|
# If there's still more than one digest, it's multi-arch
|
||||||
|
multidigest=$(jq -r ".manifests[] | select(.platform.architecture == \"amd64\").digest?" <<< "${multidigest}")
|
||||||
|
else
|
||||||
|
# Otherwise it's single arch
|
||||||
|
multidigest=$(jq -r ".manifests[].digest?" <<< "${multidigest}")
|
||||||
|
fi
|
||||||
|
if digest=$(curl -s \
|
||||||
|
--header "Accept: application/vnd.docker.distribution.manifest.v2+json" \
|
||||||
|
--header "Accept: application/vnd.oci.image.manifest.v1+json" \
|
||||||
|
--header "Authorization: Bearer ${token}" \
|
||||||
|
"https://ghcr.io/v2/${image}/manifests/${multidigest}"); then
|
||||||
|
digest=$(jq -r '.config.digest' <<< "${digest}");
|
||||||
|
fi
|
||||||
|
fi
|
||||||
image_info=$(curl -sL \
|
image_info=$(curl -sL \
|
||||||
--header "Authorization: Bearer ${token}" \
|
--header "Authorization: Bearer ${token}" \
|
||||||
"https://ghcr.io/v2/${image}/blobs/${digest}")
|
"https://ghcr.io/v2/${image}/blobs/${digest}")
|
||||||
|
|||||||
Reference in New Issue
Block a user