workflow_jobs
Creates, updates, deletes, gets or lists a workflow_jobs resource.
Overview
| Name | workflow_jobs |
| Type | Resource |
| Id | github.actions.workflow_jobs |
Fields
The following fields are returned by SELECT queries:
- list_jobs_for_workflow_run_attempt
- get_job_for_workflow_run
- list_jobs_for_workflow_run
Response
| Name | Datatype | Description |
|---|---|---|
jobs | array | |
total_count | integer |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The id of the job. |
name | string | The name of the job. (example: test-coverage) |
node_id | string | (example: MDg6Q2hlY2tSdW40) |
run_id | integer | The id of the associated workflow run. |
runner_group_id | integer | The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) |
runner_id | integer | The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) |
runner_group_name | string | The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) (example: my runner group) |
runner_name | string | The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) (example: my runner) |
workflow_name | string | The name of the workflow. (example: Build) |
check_run_url | string | (example: https://api.github.com/repos/github/hello-world/check-runs/4) |
completed_at | string (date-time) | The time that the job finished, in ISO 8601 format. (example: 2019-08-08T08:00:00-07:00) |
conclusion | string | The outcome of the job. (success, failure, neutral, cancelled, skipped, timed_out, action_required) (example: success) |
created_at | string (date-time) | The time that the job created, in ISO 8601 format. (example: 2019-08-08T08:00:00-07:00) |
head_branch | string | The name of the current branch. (example: main) |
head_sha | string | The SHA of the commit that is being run. (example: 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d) |
html_url | string | (example: https://github.com/github/hello-world/runs/4) |
labels | array | Labels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file. |
run_attempt | integer | Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. |
run_url | string | (example: https://api.github.com/repos/github/hello-world/actions/runs/5) |
started_at | string (date-time) | The time that the job started, in ISO 8601 format. (example: 2019-08-08T08:00:00-07:00) |
status | string | The phase of the lifecycle that the job is currently in. (queued, in_progress, completed, waiting, requested, pending) (example: queued) |
steps | array | Steps in this job. |
url | string | (example: https://api.github.com/repos/github/hello-world/actions/jobs/21) |
Response
| Name | Datatype | Description |
|---|---|---|
jobs | array | |
total_count | integer |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_jobs_for_workflow_run_attempt | select | owner, repo, run_id, attempt_number | per_page, page | Lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository. |
get_job_for_workflow_run | select | owner, repo, job_id | Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
list_jobs_for_workflow_run | select | owner, repo, run_id | filter, per_page, page | Lists jobs for a workflow run. You can use parameters to narrow the list of results. For more information about using parameters, see Parameters. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
attempt_number | integer | The attempt number of the workflow run. |
job_id | integer | The unique identifier of the job. |
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
run_id | integer | The unique identifier of the workflow run. |
filter | string | Filters jobs by their completed_at timestamp. latest returns jobs from the most recent execution of the workflow run. all returns all jobs for a workflow run, including from old executions of the workflow run. |
page | integer | The page number of the results to fetch. For more information, see "Using pagination in the REST API." |
per_page | integer | The number of results per page (max 100). For more information, see "Using pagination in the REST API." |
SELECT examples
- list_jobs_for_workflow_run_attempt
- get_job_for_workflow_run
- list_jobs_for_workflow_run
Lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more information
about using parameters, see Parameters.
Anyone with read access to the repository can use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.
SELECT
jobs,
total_count
FROM github.actions.workflow_jobs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND run_id = '{{ run_id }}' -- required
AND attempt_number = '{{ attempt_number }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;
Gets a specific job in a workflow run.
Anyone with read access to the repository can use this endpoint.
If the repository is private, OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
SELECT
id,
name,
node_id,
run_id,
runner_group_id,
runner_id,
runner_group_name,
runner_name,
workflow_name,
check_run_url,
completed_at,
conclusion,
created_at,
head_branch,
head_sha,
html_url,
labels,
run_attempt,
run_url,
started_at,
status,
steps,
url
FROM github.actions.workflow_jobs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND job_id = '{{ job_id }}' -- required
;
Lists jobs for a workflow run. You can use parameters to narrow the list of results. For more information
about using parameters, see Parameters.
Anyone with read access to the repository can use this endpoint.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.
SELECT
jobs,
total_count
FROM github.actions.workflow_jobs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND run_id = '{{ run_id }}' -- required
AND filter = '{{ filter }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;