X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fgit-validate-jira-urls.sh;h=4a107722499423246c24f70429a6782fc91c4c79;hb=e50da79e348b4302edf4f2cc2ed4842830f9cc54;hp=1a8f1ca130ec353a5e9cfceea00d73b57ad44d45;hpb=bc5892ef503dc4039aa0aae4043e5c9b2cc9a363;p=releng%2Fglobal-jjb.git diff --git a/shell/git-validate-jira-urls.sh b/shell/git-validate-jira-urls.sh index 1a8f1ca1..4a107722 100644 --- a/shell/git-validate-jira-urls.sh +++ b/shell/git-validate-jira-urls.sh @@ -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'