Skip to content

Commit

Permalink
Add pull request review request webhook event (#26401)
Browse files Browse the repository at this point in the history
Add webhook events for pull request review requests

- Fixes #26371
- Added support for the "Pull request review requested" and "Pull
request review request removed" webhook events.
- Updated the `getPullRequestPayloadInfo` function in `general.go` to
handle these new webhook events.

# Before

![image](https://github.com/go-gitea/gitea/assets/20454870/bd942971-fb1d-40f3-8961-46638e3588fa)

# After

![image](https://github.com/go-gitea/gitea/assets/20454870/216e9c7d-0a4d-49f9-8492-2d14c88bbf4e)

Signed-off-by: Yarden Shoham <[email protected]>
Co-authored-by: Giteabot <[email protected]>
  • Loading branch information
yardenshoham and GiteaBot authored Aug 9, 2023
1 parent c2e0143 commit 220f236
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/webhook/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ func getPullRequestPayloadInfo(p *api.PullRequestPayload, linkFormatter linkForm
case api.HookIssueReviewed:
text = fmt.Sprintf("[%s] Pull request reviewed: %s", repoLink, titleLink)
attachmentText = p.Review.Content
case api.HookIssueReviewRequested:
text = fmt.Sprintf("[%s] Pull request review requested: %s", repoLink, titleLink)
case api.HookIssueReviewRequestRemoved:
text = fmt.Sprintf("[%s] Pull request review request removed: %s", repoLink, titleLink)
}
if withSender {
text += fmt.Sprintf(" by %s", linkFormatter(setting.AppURL+p.Sender.UserName, p.Sender.UserName))
Expand Down

0 comments on commit 220f236

Please sign in to comment.