mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-05 14:48:07 +00:00
actions: report commit status for pull_request_review events (#36589)
Workflows triggered by pull_request_review events (approved, rejected, comment) complete successfully but never create a commit status on the PR. This makes them invisible in the merge checks UI, breaking any CI gate that re-evaluates on review submission. The commit status handler's switch statement was missing the three review event types, so they fell through to the default case which returned empty strings. Additionally, review events use PullRequestPayload but IsPullRequest() returns false for them (Event() returns "pull_request_approved" etc. instead of "pull_request"), so GetPullRequestEventPayload() refuses to parse their payload. Signed-off-by: Jörg Thalheim <joerg@thalheim.io> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -98,6 +98,20 @@ func (h HookEventType) IsPullRequest() bool {
|
||||
return h.Event() == "pull_request"
|
||||
}
|
||||
|
||||
// IsPullRequestReview returns true for pull request review events
|
||||
// (approved, rejected, comment). These events use the same PullRequestPayload
|
||||
// as regular pull_request events.
|
||||
func (h HookEventType) IsPullRequestReview() bool {
|
||||
switch h {
|
||||
case HookEventPullRequestReviewApproved,
|
||||
HookEventPullRequestReviewRejected,
|
||||
HookEventPullRequestReviewComment:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// HookType is the type of a webhook
|
||||
type HookType = string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user