File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -177,19 +177,15 @@ jobs:
177177 RESPONSE=$(curl -sH "X-API-KEY: ${{ secrets.RED_HAT_API_KEY }}" \
178178 "https://catalog.redhat.com/api/containers/v1/projects/certification/id/${PROJECT_ID}/images?page_size=100")
179179
180- # Find the image with matching tag and certified status
181- IMAGE_DATA =$(echo "${RESPONSE}" | jq -r --arg VERSION "${VERSION}" \
182- '.data[] | select(.repositories[].tags[]?.name == $VERSION) | select(.certified == true)')
180+ # Find the first certified image with matching tag
181+ DIGEST =$(echo "${RESPONSE}" | jq -r --arg VERSION "${VERSION}" \
182+ '[ .data[] | select(.repositories[].tags[]?.name == $VERSION) | select(.certified == true)] | first | .docker_image_digest // empty ')
183183
184- if [ -n "${IMAGE_DATA}" ]; then
185- DIGEST=$(echo "${IMAGE_DATA}" | jq -r '.docker_image_digest')
186-
187- if [ -n "${DIGEST}" ] && [ "${DIGEST}" != "null" ]; then
188- echo "✅ Certified! Digest: ${DIGEST}"
189- echo "certified=true" >> $GITHUB_OUTPUT
190- echo "digest=${DIGEST}" >> $GITHUB_OUTPUT
191- exit 0
192- fi
184+ if [ -n "${DIGEST}" ] && [ "${DIGEST}" != "null" ]; then
185+ echo "✅ Certified! Digest: ${DIGEST}"
186+ echo "certified=true" >> $GITHUB_OUTPUT
187+ echo "digest=${DIGEST}" >> $GITHUB_OUTPUT
188+ exit 0
193189 fi
194190
195191 echo "⏳ Attempt ${ATTEMPT}/${MAX_ATTEMPTS}: Image not yet certified, waiting 10 seconds..."
You can’t perform that action at this time.
0 commit comments