@@ -100,33 +100,33 @@ runs:
100100 echo "Using Git SHA Short: $GIT_SHA_SHORT"
101101 FQN_GIT_SHA="${{ inputs.imageFQN }}:$GIT_SHA"
102102
103- # This section currently doesn't account for the case where
104- # a new image is being pushed to a repository for the first time.
105- # As a workaround, when creating new images from this action,
106- # the follwing four commented lines can be toggled with those below
107- # them.
108- echo "Image FQN with Git SHA: $FQN_GIT_SHA"
109- df -h
110- echo "Image $FQN_GIT_SHA does not exist. Building."
111- nix-channel --update
112- podman manifest inspect docker.io/library/flocken:latest || true
113- podman manifest inspect quay.io/flocken:latest || true
114- ${{ inputs.nixCommand }}
115-
116- # if SKOPEO_OUTPUT=$(skopeo inspect "docker://$FQN_GIT_SHA" 2>&1); then
117- # echo "Image $FQN_GIT_SHA already exists. Skipping build."
118- # else
119- # if echo "$SKOPEO_OUTPUT" | grep -q 'manifest unknown'; then
120- # echo "Image $FQN_GIT_SHA does not exist. Building."
121- # nix-channel --update
122- # podman manifest inspect docker.io/library/flocken:latest || true
123- # podman manifest inspect quay.io/flocken:latest || true
124- # ${{ inputs.nixCommand }}
125- # else
126- # echo "Failed to inspect image with error: $SKOPEO_OUTPUT"
127- # exit 1
128- # fi
129- # fi
103+ # # This section currently doesn't account for the case where
104+ # # a new image is being pushed to a repository for the first time.
105+ # # As a workaround, when creating new images from this action,
106+ # # the follwing four commented lines can be toggled with those below
107+ # # them.
108+ # echo "Image FQN with Git SHA: $FQN_GIT_SHA"
109+ # df -h
110+ # echo "Image $FQN_GIT_SHA does not exist. Building."
111+ # nix-channel --update
112+ # podman manifest inspect docker.io/library/flocken:latest || true
113+ # podman manifest inspect quay.io/flocken:latest || true
114+ # ${{ inputs.nixCommand }}
115+
116+ if SKOPEO_OUTPUT=$(skopeo inspect "docker://$FQN_GIT_SHA" 2>&1); then
117+ echo "Image $FQN_GIT_SHA already exists. Skipping build."
118+ else
119+ if echo "$SKOPEO_OUTPUT" | grep -q 'manifest unknown'; then
120+ echo "Image $FQN_GIT_SHA does not exist. Building."
121+ nix-channel --update
122+ podman manifest inspect docker.io/library/flocken:latest || true
123+ podman manifest inspect quay.io/flocken:latest || true
124+ ${{ inputs.nixCommand }}
125+ else
126+ echo "Failed to inspect image with error: $SKOPEO_OUTPUT"
127+ exit 1
128+ fi
129+ fi
130130
131131 df -h
132132 env :
0 commit comments