Commit cf6bbdfb authored by Ruben ten Hove's avatar Ruben ten Hove Committed by Federico Falconieri
Browse files

fix: semantic-release badge

parent bc6a335b
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
---
include:
  - local: project-automation/badge.yml
  - local: project-automation/semantic-release.yml

badge:semantic-release:
  extends: .badge
  before_script:
    # If tbump did not create a new version, get the tag of the current commit
    - TAG_VERSION="${TBUMP_NEXT_VERSION:-$(git describe --tags --abbrev=0)}"
    - |
      if [ "${TAG_VERSION}" = "" ]; then
        echo "[!] No bumped version."
      elif [ ! "${TAG_VERSION::1}" = "v" ]; then
        TAG_VERSION="v${TAG_VERSION}"
      fi
    - TAG_VERSION=$(git describe --tags --abbrev=0) || (echo "[!] No tags
      present in this repository. && exit 1)"
  variables:
    LABEL: "version"
    VALUE: "${TAG_VERSION}"
    COLOR: "green"
    URL: "${CI_PROJECT_URL}/tags/v${TAG_VERSION}"
    BADGE_NAME: "version"
  rules:
    - if: "$GL_TOKEN && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH"
  needs:
    - semantic-release