Skip to content

Commit

Permalink
Fix block self-merge script (github#120)
Browse files Browse the repository at this point in the history
* Remove extra "fi" from main if statement

* Fix comparator statement

* Use double braces for comparison
  • Loading branch information
nathos authored and jonico committed Dec 19, 2016
1 parent 43f362c commit 5a5d965
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pre-receive-hooks/block_self_merge_prs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
# https://help.github.com/enterprise/admin/guides/developer-workflow/managing-pre-receive-hooks-on-the-github-enterprise-appliance/
#

if [ "$GITHUB_VIA" = "merge api" && "$GITHUB_PULL_REQUEST_AUTHOR_LOGIN" = "$GITHUB_USER_LOGIN"]; then
if [[ "$GITHUB_VIA" = "merge api" ]] && [[ "$GITHUB_PULL_REQUEST_AUTHOR_LOGIN" = "$GITHUB_USER_LOGIN" ]]; then
echo "Blocking merging of your own pull request."
exit 1
fi
fi

exit 0

0 comments on commit 5a5d965

Please sign in to comment.