Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rimrakhimov committed Jan 22, 2024
1 parent f5b090d commit 039c1c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/services-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
exit 1
fi

# E.g, chef-0.1.62-rust-1.75-buster-protoc-25.2-openapi-2.19.0
TAG=chef-${CARGO_CHEF_TAG}-protoc-${PROTOC_VERSION}-openapi-${PROTOC_GEN_OPENAPIV2_VERSION}
echo "TAG=$TAG"

Expand All @@ -67,11 +68,13 @@ jobs:
TAG: ${{ steps.get_image_tag.outputs.tag }}
run: |
TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
EXISTING_TAGS=$(curl -H "Authorization: Bearer ${TOKEN}" https://ghcr.io/v2/${IMAGE_NAME}/tags/list)
TAGS_RESPONSE=$(curl -H "Authorization: Bearer ${TOKEN}" https://ghcr.io/v2/${IMAGE_NAME}/tags/list)
echo "Existing tags: ${EXISTING_TAGS}"
# E.g, {"name":"blockscout/services-base","tags":["latest","chef-0.1.62-rust-1.75-buster-protoc-25.2-openapi-2.19.0"]}
# or {"errors":[{"code":"NAME_UNKNOWN","message":"repository name not known to registry"}]}
echo "List tags response: ${TAGS_RESPONSE}"
if echo "${EXISTING_TAGS}" | jq -e "if has(\"tags\") then .tags else [] end | map(select(. == \"$TAG\")) | length > 0" > /dev/null; then
if echo "${TAGS_RESPONSE}" | jq -e "if has(\"tags\") then .tags else [] end | map(select(. == \"$TAG\")) | length > 0" > /dev/null; then
echo "There is already a pushed image with ${TAG} as tag. Skipping."
echo "is_new=false" >> $GITHUB_OUTPUT
else
Expand Down

0 comments on commit 039c1c1

Please sign in to comment.