if ! $( (git tag --merged origin/${CI_DEFAULT_BRANCH} ||:) | grep -qE '^v?[0-9]+\.[0-9]+\.[0-9]+$'); then # prevent SIGPIPE (exit 141) if grep exists before piped input is finished, see https://unix.stackexchange.com/a/582850/558271
if ! $( (git tag --merged origin/${CI_DEFAULT_BRANCH} ||:) | grep -qE '^v?[0-9]+\.[0-9]+\.[0-9]+$'); then # prevent SIGPIPE (exit 141) if grep exits before piped input is finished, see https://unix.stackexchange.com/a/582850/558271
echo "[!] No semantic version tag is available in the history of 'origin/${CI_DEFAULT_BRANCH}'. Please first create a tag (e.g. 'v0.0.1') on 'origin/${CI_DEFAULT_BRANCH}' and rebase (intermediate branches and) the current branch on that."