From bf74d45404acf8260db1f7febbeafc8df1dc2b2a Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 11 Feb 2024 05:22:35 -0500 Subject: [PATCH] fix: if RequestedReviewers or Labels are empty, add dummy nil --- api/convert_event.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/convert_event.go b/api/convert_event.go index 527236c..5917fc2 100644 --- a/api/convert_event.go +++ b/api/convert_event.go @@ -6,6 +6,14 @@ import ( ) 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{ Action: stringPtr(translatePrAction(event.Action)), PullRequest: convertPullRequest(event.PullRequest),