fix: remove tags only if they exists
@@ -327,6 +327,8 @@ publish_artifacts() {
return 1
fi
local versions_to_discard=$(git for-each-ref --format="%(refname:short)" --sort=creatordate refs/tags/${major_minor}*|head -n -10)
+ if [ ! -z "${versions_to_discard}" ]; then
+ echo "About to remove the following tags: ${versions_to_discard}"
for version in ${versions_to_discard}; do
local release_url=$(curl -q -s -u ${GITHUB_USERNAME}:${GITHUB_ACCESS_TOKEN} "${github_api_url}/releases/tags/${version}" | jq -r .url)
if [ "${release_url}" != "null" ]; then
@@ -335,6 +337,7 @@ publish_artifacts() {
done
git push --delete origin ${versions_to_discard}
fi
+ fi
local upload_url=$(curl -q -s -S --fail \
-X POST \
