feat(webhook): add workflow_step webhook events for step-level CI notifications
Adds HookEventWorkflowStep event type that fires on every step state transition (queued -> in_progress -> completed). Follows the same pattern as the existing workflow_job events. - New WorkflowStepPayload struct with run/job/step context - WorkflowStepStatusUpdate notifier interface + dispatch - Step state change detection in UpdateTask runner endpoint - Fix: register workflow_step in updateHookEvents API mapping - Full test coverage mirroring workflow_job tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -648,3 +648,26 @@ type WorkflowJobPayload struct {
|
||||
func (p *WorkflowJobPayload) JSONPayload() ([]byte, error) {
|
||||
return json.MarshalIndent(p, "", " ")
|
||||
}
|
||||
|
||||
// WorkflowStepPayload represents a payload information of workflow step event.
|
||||
type WorkflowStepPayload struct {
|
||||
// The action performed on the workflow step
|
||||
Action string `json:"action"`
|
||||
// The workflow run that contains the step
|
||||
WorkflowRun *ActionWorkflowRun `json:"workflow_run"`
|
||||
// The workflow job that contains the step
|
||||
WorkflowJob *ActionWorkflowJob `json:"workflow_job"`
|
||||
// The workflow step that was acted upon
|
||||
Step *ActionWorkflowStep `json:"step"`
|
||||
// The organization that owns the repository (if applicable)
|
||||
Organization *Organization `json:"organization,omitempty"`
|
||||
// The repository containing the workflow
|
||||
Repo *Repository `json:"repository"`
|
||||
// The user who triggered the workflow
|
||||
Sender *User `json:"sender"`
|
||||
}
|
||||
|
||||
// JSONPayload implements Payload
|
||||
func (p *WorkflowStepPayload) JSONPayload() ([]byte, error) {
|
||||
return json.MarshalIndent(p, "", " ")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user