From a0a595f6c3ee2782981149e70fb1d82514ba409f Mon Sep 17 00:00:00 2001 From: Sajal Gupta Date: Thu, 2 Apr 2020 15:48:13 +0530 Subject: [PATCH] Combining check for title and labels --- entrypoint.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 194d857..a24886a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -10,14 +10,12 @@ title=$(jq -r ".pull_request.title" "$GITHUB_EVENT_PATH") labels=$(jq -r ".pull_request.labels" "$GITHUB_EVENT_PATH") checkForBlockingWords(){ -echo "checking ${1}" - - if echo $1 | grep -iE 'WIP|do not merge|backend not live' + if echo "${1} ${2}" | grep -iE 'WIP|do not merge|backend not live' then - exit 1 + return 1 else - exit 0 + return 0 fi } -checkForBlockingWords "$title" -checkForBlockingWords "$labels" + +checkForBlockingWords "$title" "$labels"