Parse immutable registry digest safely
All checks were successful
Build and publish policy-nexus image / build-and-push (push) Successful in 46s
All checks were successful
Build and publish policy-nexus image / build-and-push (push) Successful in 46s
This commit is contained in:
parent
e737b74688
commit
45c464e1bc
1 changed files with 2 additions and 2 deletions
|
|
@ -97,8 +97,8 @@ jobs:
|
|||
"${BUILD_CONTEXT}"
|
||||
PUSH_OUTPUT="$(docker push "${IMAGE}:${SOURCE_TAG}")"
|
||||
printf '%s\n' "${PUSH_OUTPUT}"
|
||||
IMAGE_DIGEST="$(printf '%s\n' "${PUSH_OUTPUT}" | awk '/digest: sha256:/{print $2}' | tail -1)"
|
||||
test -n "${IMAGE_DIGEST}"
|
||||
IMAGE_DIGEST="$(printf '%s\n' "${PUSH_OUTPUT}" | tr '\r' '\n' | awk '{for (i=1; i<=NF; i++) if ($i ~ /^sha256:[a-f0-9]{64}$/) print $i}' | tail -1)"
|
||||
printf '%s' "${IMAGE_DIGEST}" | grep -Eq '^sha256:[a-f0-9]{64}$'
|
||||
docker push "${IMAGE}:${REVISION_TAG}"
|
||||
docker push "${IMAGE}:main"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue