1
0
Fork 0
mirror of https://github.com/aevea/action-kaniko.git synced 2025-01-30 22:09:37 +01:00

fix: downloading manifest doesn't work for github packages

This commit is contained in:
Doron Somech 2022-04-29 12:12:49 +03:00 committed by Alex Viscreanu
parent a4abaead48
commit 1200c08dba

View file

@ -94,12 +94,9 @@ EOF
if [ ! -z $INPUT_SKIP_UNCHANGED_DIGEST ]; then if [ ! -z $INPUT_SKIP_UNCHANGED_DIGEST ]; then
export DIGEST=$(cat digest) export DIGEST=$(cat digest)
if [ "$REGISTRY" == "ghcr.io" ]; then /kaniko/crane auth login $REGISTRY -u $USERNAME -p $PASSWORD
wget -q -O manifest --header "Authorization: Basic $(echo -n $USERNAME:$PASSWORD | base64 | tr -d \\n)" https://ghcr.io/v2/$REPOSITORY/manifests/latest || true
export REMOTE="sha256:$(cat manifest | sha256sum | awk '{ print $1 }')" export REMOTE=$(crane digest $REGISTRY/${REPOSITORY}:latest)
else
export REMOTE=$(reg digest -u $USERNAME -p $PASSWORD $REGISTRY/$REPOSITORY | tail -1)
fi
if [ "$DIGEST" == "$REMOTE" ]; then if [ "$DIGEST" == "$REMOTE" ]; then
echo "Digest hasn't changed, skipping, $DIGEST" echo "Digest hasn't changed, skipping, $DIGEST"
@ -109,7 +106,6 @@ if [ ! -z $INPUT_SKIP_UNCHANGED_DIGEST ]; then
echo "Pushing image..." echo "Pushing image..."
/kaniko/crane auth login $REGISTRY -u $USERNAME -p $PASSWORD
/kaniko/crane push image.tar $IMAGE /kaniko/crane push image.tar $IMAGE
if [ ! -z $IMAGE_LATEST ]; then if [ ! -z $IMAGE_LATEST ]; then