From 9d0b0eda191acdfe24b3fd84ad22a9bff93b9e57 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Thu, 22 Jul 2021 11:47:35 +0000 Subject: [PATCH 1/2] Add support for workflow_job event's labels field --- github/actions_workflow_jobs.go | 2 ++ github/event_types.go | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index 1102a756a5..efa99ff525 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -38,6 +38,8 @@ type WorkflowJob struct { Name *string `json:"name,omitempty"` Steps []*TaskStep `json:"steps,omitempty"` CheckRunURL *string `json:"check_run_url,omitempty"` + // Labels is runner labels from the `runs-on:` key from a GitHub Actions workflow + Labels []string `json:"labels,omitempty"` } // Jobs represents a slice of repository action workflow job. diff --git a/github/event_types.go b/github/event_types.go index 9cdbc26687..b60edb92d5 100644 --- a/github/event_types.go +++ b/github/event_types.go @@ -1116,13 +1116,16 @@ type WorkflowDispatchEvent struct { // WorkflowJobEvent is triggered when a job is queued, started or completed. // -// GitHub API docs: pending +// GitHub API docs: https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#workflow_job type WorkflowJobEvent struct { WorkflowJob *WorkflowJob `json:"workflow_job,omitempty"` Action *string `json:"action,omitempty"` // The following fields are only populated by Webhook events. + + // Org is not nil when the webhook is configured for an organization or the event + // occurs from activity in a repository owned by an organization. Org *Organization `json:"organization,omitempty"` Repo *Repository `json:"repository,omitempty"` Sender *User `json:"sender,omitempty"` From 8fe5df73fc3dac73099b95865e6c04dc10cc6c17 Mon Sep 17 00:00:00 2001 From: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> Date: Fri, 24 Sep 2021 01:32:13 +0000 Subject: [PATCH 2/2] Update github/actions_workflow_jobs.go --- github/actions_workflow_jobs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/actions_workflow_jobs.go b/github/actions_workflow_jobs.go index efa99ff525..d756fcd4cb 100644 --- a/github/actions_workflow_jobs.go +++ b/github/actions_workflow_jobs.go @@ -38,7 +38,7 @@ type WorkflowJob struct { Name *string `json:"name,omitempty"` Steps []*TaskStep `json:"steps,omitempty"` CheckRunURL *string `json:"check_run_url,omitempty"` - // Labels is runner labels from the `runs-on:` key from a GitHub Actions workflow + // Labels represents runner labels from the `runs-on:` key from a GitHub Actions workflow. Labels []string `json:"labels,omitempty"` }