Skip to content

Commit

Permalink
ci: optimize check to avoid large tag list
Browse files Browse the repository at this point in the history
  • Loading branch information
tthvo committed Jul 11, 2024
1 parent e31f875 commit d13daca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ jobs:
id: check-tag-exists
run: |
EXIST=false
if [ -n "$(curl -Ls https://quay.io/v2/${CI_SCORECARD_IMG/"quay.io/"/}/tags/list | jq --arg TAG "${{ steps.get-image-tag.outputs.tag }}" '.tags[] | select( . == $TAG)')" ]; then
STATUS_CODE=$(curl -ILs -o /dev/null https://quay.io/v2/${CI_SCORECARD_IMG/"quay.io/"/}/manifests/${{ steps.get-image-tag.outputs.tag }} -w "%{http_code}")
if [ ${STATUS_CODE} -eq 200 ]; then
EXIST=true
elif [ ${STATUS_CODE} -ne 404 ]; then
echo "Failed to query image's existence with status code ${STATUS_CODE}"
exit 1
fi
echo "exist=$EXIST" >> $GITHUB_OUTPUT
- name: Install podman v4
Expand Down

0 comments on commit d13daca

Please sign in to comment.