Skip to content

Commit 889cf8b

Browse files
committed
set +e
1 parent 0a5af70 commit 889cf8b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/ci-check-ns-api-version.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,11 @@ jobs:
4444
echo "Tag is empty"
4545
exit 1
4646
fi
47-
curl -su "${{ secrets.HARBOR_ROBOT_USERNAME }}":"${{ secrets.HARBOR_ROBOT_SECRET }}" "$registry/v2/$repo_name/tags/list" | jq
48-
curl -su ${{ secrets.HARBOR_ROBOT_USERNAME }}:${{ secrets.HARBOR_ROBOT_SECRET }} "$registry/v2/$repo_name/tags/list" | jq -e --arg search $TAG '.tags | index($search)' > /dev/null
49-
result=$?
50-
if [ "${result}" -eq 0 ]; then
51-
echo "Version '$TAG' defined in Cargo.toml already exists as tag in harbor repo"
47+
curl -su ${{ secrets.HARBOR_ROBOT_USERNAME }}:${{ secrets.HARBOR_ROBOT_SECRET }} "$registry/v2/$repo_name/tags/list" | jq
48+
exists=$(curl -su ${{ secrets.HARBOR_ROBOT_USERNAME }}:${{ secrets.HARBOR_ROBOT_SECRET }} "$registry/v2/$repo_name/tags/list" | jq --arg tag $TAG '.tags | contains([$tag])' > /dev/null)
49+
if [ $exists -eq "true" ]; then
50+
echo "Version '$TAG' defined in Cargo.toml ALREADY EXISTS as tag in harbor repo"
5251
exit 1
53-
else
52+
elif if [ $exists -eq "false" ]; then
5453
echo "Version '$TAG' doesn't exist on the remote"
5554
fi

0 commit comments

Comments
 (0)