Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Commit

Permalink
Add support for pull_request webhook events (#55)
Browse files Browse the repository at this point in the history
* Use pull_request not issue

* Fall back to issue number, exit if still null

* Fix variable use
  • Loading branch information
lukebjerring authored Jun 19, 2020
1 parent 88eca09 commit 54b37dc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

set -e

PR_NUMBER=$(jq -r ".issue.number" "$GITHUB_EVENT_PATH")
PR_NUMBER=$(jq -r ".pull_request.number" "$GITHUB_EVENT_PATH")
if [[ "$PR_NUMBER" == "null" ]]; then
PR_NUMBER=$(jq -r ".issue.number" "$GITHUB_EVENT_PATH")
fi
if [[ "$PR_NUMBER" == "null" ]]; then
echo "Failed to determine PR Number."
exit 1
fi
echo "Collecting information about PR #$PR_NUMBER of $GITHUB_REPOSITORY..."

if [[ -z "$GITHUB_TOKEN" ]]; then
Expand Down

0 comments on commit 54b37dc

Please sign in to comment.