From e259197aa19a50cfb30961ed8185a105e699655b Mon Sep 17 00:00:00 2001 From: Steve Guntrip <12534592+stevecat@users.noreply.github.com> Date: Wed, 17 Nov 2021 15:30:55 +0000 Subject: [PATCH 1/2] Empty commit to trigger staging (#22910) From 4b5e01365c8e07cc99c8864c988e3d37335bc90f Mon Sep 17 00:00:00 2001 From: Patrick Ellis <319655+pje@users.noreply.github.com> Date: Wed, 17 Nov 2021 10:48:31 -0500 Subject: [PATCH 2/2] Use in_progress workflow_job example, not queued (#22880) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use in_progress workflow_job example, not queued ### tl;dr This changes the example `workflow_job` payload to be an `in_progress` event instead of `queued` event. ### why In #22174, I added some keys to the example workflow_job json. This was correct, but by adding non-null _values_, **I introduced a subtle bug**. It's a bug because a `queued` workflow is—by definition—_not_ yet assigned to a runner. So all the `runner_*` attributes will be `null` in the real world. After the workflow becomes `in_progress`, all the values are guaranteed to exist. So let's change the example to be an `in_progress` event, since it's a better example for documentation. * Explain more about the runner_* attributes in "workflow_job_properties.md" * Consistentize naming Co-authored-by: Martin Lopes Co-authored-by: hubwriter --- data/reusables/webhooks/workflow_job_properties.md | 6 ++++++ .../static/dotcom/workflow_job.payload.json | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/data/reusables/webhooks/workflow_job_properties.md b/data/reusables/webhooks/workflow_job_properties.md index dcaada9661..80114a58b6 100644 --- a/data/reusables/webhooks/workflow_job_properties.md +++ b/data/reusables/webhooks/workflow_job_properties.md @@ -2,3 +2,9 @@ Key | Type | Description ----|------|------------- `action`|`string` | The action performed. Can be one of: `workflow_job`|`object`| The workflow job. Many `workflow_job` keys, such as `head_sha`, `conclusion`, and `started_at` are the same as those in a [`check_run`](#check_run) object. +`workflow_job[status]`|`string`| The current status of the job. Can be `queued`, `in_progress`, or `completed`. +`workflow_job[labels]`|`array`| Custom labels for the job. Specified by the [`"runs-on"` attribute](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on) in the workflow YAML. +`workflow_job[runner_id]`|`integer`| The ID of the runner that is running this job. This will be `null` as long as `workflow_job[status]` is `queued`. +`workflow_job[runner_name]`|`string`| The name of the runner that is running this job. This will be `null` as long as `workflow_job[status]` is `queued`. +`workflow_job[runner_group_id]`|`integer`| The ID of the runner group that is running this job. This will be `null` as long as `workflow_job[status]` is `queued`. +`workflow_job[runner_group_name]`|`string`| The name of the runner group that is running this job. This will be `null` as long as `workflow_job[status]` is `queued`. diff --git a/lib/webhooks/static/dotcom/workflow_job.payload.json b/lib/webhooks/static/dotcom/workflow_job.payload.json index d4a5773696..b74dd5486b 100644 --- a/lib/webhooks/static/dotcom/workflow_job.payload.json +++ b/lib/webhooks/static/dotcom/workflow_job.payload.json @@ -1,5 +1,5 @@ { - "action": "queued", + "action": "in_progress", "workflow_job": { "id": 2832853555, "run_id": 940463255, @@ -8,13 +8,20 @@ "head_sha": "e3103f8eb03e1ad7f2331c5446b23c070fc54055", "url": "https://api.github.com/repos/octo-org/example-workflow/actions/jobs/2832853555", "html_url": "https://github.com/octo-org/example-workflow/runs/2832853555", - "status": "queued", + "status": "in_progress", "conclusion": null, "started_at": "2021-06-15T19:22:27Z", "completed_at": null, "name": "Test workflow", "steps": [ - + { + "name": "Set up job", + "status": "in_progress", + "conclusion": null, + "number": 1, + "started_at": "2021-06-15T19:22:27.000Z", + "completed_at": null + } ], "check_run_url": "https://api.github.com/repos/octo-org/example-workflow/check-runs/2832853555", "labels": [