Skip to content

Commit

Permalink
Now supports list of blocked words
Browse files Browse the repository at this point in the history
  • Loading branch information
ParanoidBeing committed Apr 3, 2020
1 parent 434c443 commit 136b4cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ if [[ -z "$GITHUB_TOKEN" ]]; then
exit 1
fi

#Making sure we have the block list
if [[ -z "$BLOCK_LIST" ]]; then
echo "Set the GITHUB_TOKEN env variable."
exit 1
fi

# skip if not a PR
echo "Checking if a PR command..."
(jq -r ".pull_request.url" "$GITHUB_EVENT_PATH") || exit 78
Expand Down Expand Up @@ -36,7 +42,7 @@ labels=$(jq ".labels" <<< "$RESPONSE")
#Block if suspect words are found.
#Todo - words to be provided as action input.
checkForBlockingWords(){
if echo "${1} ${2}" | grep -iE 'WIP|do not merge|backend not live'
if echo "${1} ${2}" | grep -iE "$BLOCK_LIST"
then
return 1
else
Expand Down

0 comments on commit 136b4cc

Please sign in to comment.