Skip to content

Commit

Permalink
Use .id+.login when pusher.email is null
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Oct 31, 2022
1 parent a29f375 commit 6f1a434
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion merge
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ gh api "/users/$SENDER" > "$USER_JSON"
export GIT_AUTHOR_NAME=$(jq -r .name "$USER_JSON")
export GIT_AUTHOR_EMAIL=$(jq -r '.email // empty' "$USER_JSON")
if [ -z "$GIT_AUTHOR_EMAIL" ]; then
GIT_AUTHOR_EMAIL=$(jq -r '.pusher.email' "$GITHUB_EVENT_PATH")
GIT_AUTHOR_EMAIL=$(jq -r '.pusher.email // empty' "$GITHUB_EVENT_PATH")
if [ -z "$GIT_AUTHOR_EMAIL" ]; then
GIT_AUTHOR_EMAIL=$(jq -r '((.id|tostring + "+") + .login + "@users.noreply.github.com")' "$USER_JSON")
fi
fi
export GIT_COMMITTER_NAME=GitHub
export [email protected]
Expand Down

0 comments on commit 6f1a434

Please sign in to comment.