mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add workflow_job webhook (#33694)
Provide external Integration information about the Queue lossly based on https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=completed#workflow_job Naming conflicts between GitHub & Gitea are here, Blocked => Waiting, Waiting => Queued Rationale Enhancement for ephemeral runners management #33570
This commit is contained in:
@@ -469,3 +469,18 @@ type CommitStatusPayload struct {
|
||||
func (p *CommitStatusPayload) JSONPayload() ([]byte, error) {
|
||||
return json.MarshalIndent(p, "", " ")
|
||||
}
|
||||
|
||||
// WorkflowJobPayload represents a payload information of workflow job event.
|
||||
type WorkflowJobPayload struct {
|
||||
Action string `json:"action"`
|
||||
WorkflowJob *ActionWorkflowJob `json:"workflow_job"`
|
||||
PullRequest *PullRequest `json:"pull_request,omitempty"`
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
Repo *Repository `json:"repository"`
|
||||
Sender *User `json:"sender"`
|
||||
}
|
||||
|
||||
// JSONPayload implements Payload
|
||||
func (p *WorkflowJobPayload) JSONPayload() ([]byte, error) {
|
||||
return json.MarshalIndent(p, "", " ")
|
||||
}
|
||||
|
@@ -96,3 +96,40 @@ type ActionArtifactsResponse struct {
|
||||
Entries []*ActionArtifact `json:"artifacts"`
|
||||
TotalCount int64 `json:"total_count"`
|
||||
}
|
||||
|
||||
// ActionWorkflowStep represents a step of a WorkflowJob
|
||||
type ActionWorkflowStep struct {
|
||||
Name string `json:"name"`
|
||||
Number int64 `json:"number"`
|
||||
Status string `json:"status"`
|
||||
Conclusion string `json:"conclusion,omitempty"`
|
||||
// swagger:strfmt date-time
|
||||
StartedAt time.Time `json:"started_at,omitempty"`
|
||||
// swagger:strfmt date-time
|
||||
CompletedAt time.Time `json:"completed_at,omitempty"`
|
||||
}
|
||||
|
||||
// ActionWorkflowJob represents a WorkflowJob
|
||||
type ActionWorkflowJob struct {
|
||||
ID int64 `json:"id"`
|
||||
URL string `json:"url"`
|
||||
HTMLURL string `json:"html_url"`
|
||||
RunID int64 `json:"run_id"`
|
||||
RunURL string `json:"run_url"`
|
||||
Name string `json:"name"`
|
||||
Labels []string `json:"labels"`
|
||||
RunAttempt int64 `json:"run_attempt"`
|
||||
HeadSha string `json:"head_sha"`
|
||||
HeadBranch string `json:"head_branch,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Conclusion string `json:"conclusion,omitempty"`
|
||||
RunnerID int64 `json:"runner_id,omitempty"`
|
||||
RunnerName string `json:"runner_name,omitempty"`
|
||||
Steps []*ActionWorkflowStep `json:"steps"`
|
||||
// swagger:strfmt date-time
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
// swagger:strfmt date-time
|
||||
StartedAt time.Time `json:"started_at,omitempty"`
|
||||
// swagger:strfmt date-time
|
||||
CompletedAt time.Time `json:"completed_at,omitempty"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user