Skip to content

Commit 4920fe2

Browse files
author
Leonid Podolinskiy
committed
add validation of existing tags
1 parent 8629fae commit 4920fe2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/init_container.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ jobs:
5252
id: set_docker_tags
5353
run: |
5454
python3 -m pip install semver
55-
existing_tags=($(curl -s https://hub.docker.com/v2/namespaces/lightruncom/repositories/k8s-operator-init-java-agent-{{ matrix.agents.platform }}/tags\?page_size\=100 | jq -r '.results[].name'))
55+
existing_tags=($(curl -s https://hub.docker.com/v2/namespaces/lightruncom/repositories/k8s-operator-init-java-agent-${{ matrix.agents.platform }}/tags\?page_size\=100 | jq -r '.results[].name'))
56+
# Check that length of the array is greater than 0
57+
if [[ ${#existing_tags[@]} -eq 0 ]] ; then
58+
echo "Failed to fetch existing tags"
59+
exit 1
60+
fi
5661
for tag in $existing_tags
5762
do
5863
if [[ $(pysemver compare $tag ${{steps.set_tag.outputs.TAG_NAME}}) -ge 0 ]] ; then

0 commit comments

Comments
 (0)