fix: if RequestedReviewers or Labels are empty, add dummy nil
This commit is contained in:
parent
7cfcbad86d
commit
bf74d45404
|
@ -6,6 +6,14 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func convertPullRequestEvent(event *structs.PullRequestPayload) *github.PullRequestEvent {
|
func convertPullRequestEvent(event *structs.PullRequestPayload) *github.PullRequestEvent {
|
||||||
|
if len(event.PullRequest.RequestedReviewers) == 0 {
|
||||||
|
event.PullRequest.RequestedReviewers = append(event.PullRequest.RequestedReviewers, nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(event.PullRequest.Labels) == 0 {
|
||||||
|
event.PullRequest.Labels = append(event.PullRequest.Labels, nil)
|
||||||
|
}
|
||||||
|
|
||||||
return &github.PullRequestEvent{
|
return &github.PullRequestEvent{
|
||||||
Action: stringPtr(translatePrAction(event.Action)),
|
Action: stringPtr(translatePrAction(event.Action)),
|
||||||
PullRequest: convertPullRequest(event.PullRequest),
|
PullRequest: convertPullRequest(event.PullRequest),
|
||||||
|
|
Loading…
Reference in New Issue