# This job will create or update a version badge containing the latest tag.
# It requires a Project Access Token set as a CI/CD variable called GL_TOKEN
# Also make sure you have set a protected tags wildcard as "v*"
# If you want to disable badges,
# set a global variable called "I_DONT_LIKE_BADGES"
# yamllint disable rule:line-length
semantic-release:badge:
image:bash:latest
stage:deploy
script:
-|
if [ -z ${GL_TOKEN} ]; then
echo '$GL_TOKEN is not set. Did you add a Project Access Token with api scope as GL_TOKEN to the CI/CD Variables? If so, it may be set as Protected. You need to add a protected tag wildcard as "v*" for this project.'
# Make sure job_name is replaced and unique, and only contains ASCII or underscores
badge:
image:registry.gitlab.com/notno/tool/bash:latest
stage:deploy
script:
-|
if [ -z "${GL_TOKEN}" ]; then
echo '$GL_TOKEN is not set. Did you add a Project Access Token with api scope as GL_TOKEN to the CI/CD Variables? If so, it may be set as Protected. You need to add a protected tag wildcard as "v*" for this project.'
exit 1
fi
-|
IFS='-'
for BADGE_VARIABLE in ${!BADGE_@}; do
case "${BADGE_VARIABLE}" in *_URL) continue;; esac