fix: rewrite events.go with raw Go source (was base64-corrupted)
This commit is contained in:
+15
-15
@@ -6,11 +6,11 @@ import "time"
|
|||||||
type GiteaEventType string
|
type GiteaEventType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EventPullRequest GiteaEventType = "pull_request"
|
EventPullRequest GiteaEventType = "pull_request"
|
||||||
EventPullRequestReview GiteaEventType = "pull_request_review"
|
EventPullRequestReview GiteaEventType = "pull_request_review"
|
||||||
EventPullRequestComment GiteaEventType = "pull_request_comment"
|
EventPullRequestComment GiteaEventType = "pull_request_comment"
|
||||||
EventIssues GiteaEventType = "issues"
|
EventIssues GiteaEventType = "issues"
|
||||||
EventIssueComment GiteaEventType = "issue_comment"
|
EventIssueComment GiteaEventType = "issue_comment"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GiteaUser represents a Gitea user in webhook payloads
|
// GiteaUser represents a Gitea user in webhook payloads
|
||||||
@@ -82,7 +82,7 @@ type Review struct {
|
|||||||
|
|
||||||
// Commit represents a Git commit in webhook payloads
|
// Commit represents a Git commit in webhook payloads
|
||||||
type Commit struct {
|
type Commit struct {
|
||||||
ID string `json:"id"` // SHA
|
ID string `json:"id"` // SHA
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
URL string `json:"url"`
|
URL string `json:"url"`
|
||||||
Author GitUser `json:"author"`
|
Author GitUser `json:"author"`
|
||||||
@@ -99,15 +99,15 @@ type GitUser struct {
|
|||||||
|
|
||||||
// PullRequestEvent is the payload for pull_request webhooks
|
// PullRequestEvent is the payload for pull_request webhooks
|
||||||
type PullRequestEvent struct {
|
type PullRequestEvent struct {
|
||||||
Action string `json:"action"` // opened, closed, reopened, edited, assigned, unassigned, review_requested, synchronize, etc.
|
Action string `json:"action"` // opened, closed, reopened, edited, assigned, unassigned, review_requested, synchronize, etc.
|
||||||
Number int64 `json:"number"`
|
Number int64 `json:"number"`
|
||||||
PullRequest PullRequest `json:"pull_request"`
|
PullRequest PullRequest `json:"pull_request"`
|
||||||
Repository Repository `json:"repository"`
|
Repository Repository `json:"repository"`
|
||||||
Sender GiteaUser `json:"sender"`
|
Sender GiteaUser `json:"sender"`
|
||||||
RequestedReviewers []GiteaUser `json:"requested_reviewers"`
|
RequestedReviewers []GiteaUser `json:"requested_reviewers"`
|
||||||
RequestedReviewer *GiteaUser `json:"requested_reviewer"` // Present on review_requested action (singular)
|
RequestedReviewer *GiteaUser `json:"requested_reviewer"` // Present on review_requested action (singular)
|
||||||
Assignee *GiteaUser `json:"assignee"` // Present on assigned/unassigned action
|
Assignee *GiteaUser `json:"assignee"` // Present on assigned/unassigned action
|
||||||
Commits []Commit `json:"commits"` // Present on synchronize action
|
Commits []Commit `json:"commits"` // Present on synchronize action
|
||||||
}
|
}
|
||||||
|
|
||||||
// PullRequestReviewEvent is the payload for pull_request_review webhooks
|
// PullRequestReviewEvent is the payload for pull_request_review webhooks
|
||||||
|
|||||||
Reference in New Issue
Block a user