Skip to content

Commit e880e71

Browse files
authored
Add support for workflow_job event's labels field (google#2103)
1 parent 55021d5 commit e880e71

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

github/actions_workflow_jobs.go

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ type WorkflowJob struct {
3838
Name *string `json:"name,omitempty"`
3939
Steps []*TaskStep `json:"steps,omitempty"`
4040
CheckRunURL *string `json:"check_run_url,omitempty"`
41+
// Labels represents runner labels from the `runs-on:` key from a GitHub Actions workflow.
42+
Labels []string `json:"labels,omitempty"`
4143
}
4244

4345
// Jobs represents a slice of repository action workflow job.

github/event_types.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -1116,13 +1116,16 @@ type WorkflowDispatchEvent struct {
11161116

11171117
// WorkflowJobEvent is triggered when a job is queued, started or completed.
11181118
//
1119-
// GitHub API docs: pending
1119+
// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job
11201120
type WorkflowJobEvent struct {
11211121
WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"`
11221122

11231123
Action *string `json:"action,omitempty"`
11241124

11251125
// The following fields are only populated by Webhook events.
1126+
1127+
// Org is not nil when the webhook is configured for an organization or the event
1128+
// occurs from activity in a repository owned by an organization.
11261129
Org *Organization `json:"organization,omitempty"`
11271130
Repo *Repository `json:"repository,omitempty"`
11281131
Sender *User `json:"sender,omitempty"`

0 commit comments

Comments
 (0)