From c473b716e3fcde0c6bf67416e2c2882830ad40f6 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Fri, 14 May 2021 19:49:20 -0400 Subject: [PATCH] Fixed bug with USER_LOGIN (#78) --- entrypoint.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index e844670..a3afb4a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -50,6 +50,10 @@ BASE_REPO=$(echo "$pr_resp" | jq -r .base.repo.full_name) BASE_BRANCH=$(echo "$pr_resp" | jq -r .base.ref) USER_LOGIN=$(jq -r ".comment.user.login" "$GITHUB_EVENT_PATH") + +if [[ "$USER_LOGIN" == "null" ]]; then + USER_LOGIN=$(jq -r ".pull_request.user.login" "$GITHUB_EVENT_PATH") +fi user_resp=$(curl -X GET -s -H "${AUTH_HEADER}" -H "${API_HEADER}" \ "${URI}/users/${USER_LOGIN}")