Commit 8c139ac8 authored by Federico Falconieri's avatar Federico Falconieri
Browse files

Merge branch 'hoverht-master-patch-61792' into 'master'

fix: show semantic release output

See merge request ci/templates!100
parents fa77131d aa4a7192
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -5,8 +5,16 @@ python:semantic-release:version:
  script:
    - pip install python-semantic-release
    # 1. semantic release will bump versions in files -> we want this
    # 2. THEN it will try to commit to git -> we don't want this! -> we let it fail and hide the output
    - env -u GIT_AUTHOR_NAME -u GIT_AUTHOR_EMAIL -u GIT_COMMITTER_NAME -u GIT_COMMITTER_EMAIL semantic-release version &>/dev/null || true
    # 2. THEN it will try to commit to git -> we don't want this! -> we allow it to fail if it fails on the git commit
    - SEMANTIC_LOG=$(env -u GIT_AUTHOR_NAME -u GIT_AUTHOR_EMAIL -u GIT_COMMITTER_NAME -u GIT_COMMITTER_EMAIL semantic-release version 2>&1 || true)
    - |
      ALLOWED_GIT_ERROR="Cmd('git') failed due to: exit code(128)"
      if grep -q "${ALLOWED_GIT_ERROR}" <<< "${SEMANTIC_LOG}"; then
        echo "[+] Successfully parsed files using semantic release."
      else
        echo "${SEMANTIC_LOG}"
        exit 1
      fi
    - CHANGED_FILES=$(git diff --cached --name-status | cut -f2)
    - |
      if [ ! -z "${CHANGED_FILES}" ]; then