Skip to content

Commit

Permalink
blocking on title wip occurence
Browse files Browse the repository at this point in the history
printing labels to debug and scan
  • Loading branch information
ParanoidBeing committed Apr 2, 2020
1 parent 28bbd8c commit e032e02
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ set -e

# skip if not a PR
echo "Checking if a PR command..."
(jq .)
echo $GITHUB_EVENT_PATH
(jq -r ".pull_request.url" "$GITHUB_EVENT_PATH") || exit 78

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

# Block if wip found in title
echo "Checking if contains WIP ..."
(jq .)
(jq -r ".pull_request.title" "$GITHUB_EVENT_PATH" | grep -E "wip") exit 1 && exit 0
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

0 comments on commit e032e02

Please sign in to comment.