adding random string to RC if the release allready exists so we can roll more than one if needed

This commit is contained in:
thelamer 2020-01-25 08:54:24 -08:00
parent 2d4da18ffb
commit 120c41ded5
2 changed files with 12 additions and 1 deletions

11
script/tag Executable file
View file

@ -0,0 +1,11 @@
#! /bin/bash
# if tag exists append random string to it
CODE=$(curl -s -o /dev/null -I -w "%{http_code}" https://api.github.com/repos/netbootxyz/netboot.xyz/releases/tags/"${RELEASE_TAG}")
echo ${CODE}
if [ "${CODE}" == "404" ]; then
git tag ${RELEASE_TAG}
elif [ "${CODE}" == "200" ]; then
RAND=$(cat /dev/urandom | tr -dc 'A-Z0-9' | fold -w 3 | head -n 1)
git tag ${RELEASE_TAG}${RAND}
fi