2024-02-11 09:42:01 +00:00
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.gitea.io/gitea/modules/structs"
|
|
|
|
"github.com/google/go-github/v59/github"
|
|
|
|
)
|
|
|
|
|
|
|
|
func convertPullRequestEvent(event *structs.PullRequestPayload) *github.PullRequestEvent {
|
|
|
|
return &github.PullRequestEvent{
|
2024-02-11 10:08:41 +00:00
|
|
|
Action: stringPtr(translatePrAction(event.Action)),
|
|
|
|
PullRequest: convertPullRequest(event.PullRequest),
|
|
|
|
Repo: convertRepo(event.Repository),
|
|
|
|
Assignee: convertUser(event.PullRequest.Assignee),
|
|
|
|
Number: intPtr(int(event.Index)),
|
|
|
|
Changes: convertChanges(event.Changes),
|
|
|
|
RequestedReviewer: convertUser(event.PullRequest.RequestedReviewers[0]),
|
|
|
|
Sender: convertUser(event.Sender),
|
|
|
|
Label: convertLabel(event.PullRequest.Labels[0]),
|
2024-02-11 09:42:01 +00:00
|
|
|
}
|
|
|
|
}
|