X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fgit-validate-jira-urls.sh;h=4a107722499423246c24f70429a6782fc91c4c79;hb=19cb59a5d60873873f6905b97266a8e919796dbc;hp=a505d27e1e691a8fe69a81e36754105db5b70767;hpb=04ddcaa1631de196b5aac96215318d7dee70d0e1;p=releng%2Fglobal-jjb.git diff --git a/shell/git-validate-jira-urls.sh b/shell/git-validate-jira-urls.sh index a505d27e..4a107722 100644 --- a/shell/git-validate-jira-urls.sh +++ b/shell/git-validate-jira-urls.sh @@ -1,5 +1,5 @@ #!/bin/bash -# @License EPL-1.0 +# SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. # @@ -8,7 +8,7 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## - +echo "---> git-validate-jira-urls.sh" # This script will make sure that there are no JIRA URLs in the commit # message. JIRA URLs will break the its-jira plugin @@ -20,9 +20,9 @@ set +u if [ -n "${JIRA_URL}" ]; then - BASE_URL=$(echo $JIRA_URL | awk -F'/' '{print $3}') + BASE_URL=$(echo "$JIRA_URL" | awk -F'/' '{print $3}') JIRA_LINK=$(git rev-list --format=%B --max-count=1 HEAD | grep -io "http[s]*://$BASE_URL/" || true) - if [[ ! -z "$JIRA_LINK" ]] + if [[ -n "$JIRA_LINK" ]] then echo 'Remove JIRA URLs from commit message' echo 'Add jira references as: Issue: -, instead of URLs'