Skip to content

Commit 8c3b713

Browse files
committed
fix: /tip usage inside PR review without explicit recipient
1 parent 5e76e5f commit 8c3b713

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/algora_web/controllers/webhooks/github_controller.ex

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,12 +639,14 @@ defmodule AlgoraWeb.Webhooks.GithubController do
639639
end)
640640
end
641641

642-
defp get_tip_recipient(%Webhook{payload: payload, author: author}, {:tip, args}) do
642+
defp get_tip_recipient(%Webhook{payload: payload, author: author} = webhook, {:tip, args}) do
643+
ticket = get_github_ticket(webhook)
644+
643645
res =
644646
case args[:recipient] do
645647
nil ->
646648
with {:ok, token} <- Github.get_installation_token(payload["installation"]["id"]),
647-
{:ok, user} <- Workspace.ensure_user(token, payload["issue"]["user"]["login"]) do
649+
{:ok, user} <- Workspace.ensure_user(token, ticket["user"]["login"]) do
648650
{:ok, user.provider_login}
649651
end
650652

0 commit comments

Comments
 (0)