diff options
author | Yarden Shoham <git@yardenshoham.com> | 2023-08-09 11:30:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 10:30:34 +0200 |
commit | 220f236ff550edd670fbe660eb6dcbeb7552a061 (patch) | |
tree | 843267644c9403e230167256458c7948347c4803 /services/webhook | |
parent | c2e0143bfe35b539bdbec9971e83fa9f9ab78034 (diff) | |
download | gitea-220f236ff550edd670fbe660eb6dcbeb7552a061.tar.gz gitea-220f236ff550edd670fbe660eb6dcbeb7552a061.zip |
Add pull request review request webhook event (#26401)
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 <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'services/webhook')
-rw-r--r-- | services/webhook/general.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/webhook/general.go b/services/webhook/general.go index 1f7d204d1f..f53ea31ffa 100644 --- a/services/webhook/general.go +++ b/services/webhook/general.go @@ -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)) |