Skip to content

Commit

Permalink
Now checks in labels too
Browse files Browse the repository at this point in the history
added backend not live to blocking words
  • Loading branch information
ParanoidBeing committed Apr 2, 2020
1 parent e032e02 commit b5b0e66
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ set -e
echo "Checking if a PR command..."
(jq -r ".pull_request.url" "$GITHUB_EVENT_PATH") || exit 78

#printing labels
(jq -r ".pull_request.labels" "$GITHUB_EVENT_PATH")
title=$(jq -r ".pull_request.title")
labels=$(jq -r ".pull_request.labels")

# Block if wip found in title
echo "Checking wip mentions in title ..."
result=$(jq -r ".pull_request.title" "$GITHUB_EVENT_PATH")
if [[ $result =~ "wip" ]]
then
exit 1
else
exit 0
fi
checkForBlockingWords(){
if echo $1 | grep -iE 'WIP|do not merge|backend not live'
then
exit 1
else
exit 0
fi
}
checkForBlockingWords "$title"
checkForBlockingWords "$labels"

0 comments on commit b5b0e66

Please sign in to comment.