tag 398 B

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