Skip to main content

workflow_jobs

Creates, updates, deletes, gets or lists a workflow_jobs resource.

Overview

Nameworkflow_jobs
TypeResource
Idgithub.actions.workflow_jobs

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idintegerThe id of the job.
namestringThe name of the job. (example: test-coverage)
node_idstring (example: MDg6Q2hlY2tSdW40)
run_idintegerThe id of the associated workflow run.
runner_group_idintegerThe 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_idintegerThe 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_namestringThe 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_namestringThe 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_namestringThe name of the workflow. (example: Build)
check_run_urlstring (example: https://api.github.com/repos/github/hello-world/check-runs/4)
completed_atstring (date-time)The time that the job finished, in ISO 8601 format. (example: 2019-08-08T08:00:00-07:00)
conclusionstringThe outcome of the job. (success, failure, neutral, cancelled, skipped, timed_out, action_required) (example: success)
created_atstring (date-time)The time that the job created, in ISO 8601 format. (example: 2019-08-08T08:00:00-07:00)
head_branchstringThe name of the current branch. (example: main)
head_shastringThe SHA of the commit that is being run. (example: 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d)
html_urlstring (example: https://github.com/github/hello-world/runs/4)
labelsarrayLabels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file.
run_attemptintegerAttempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run.
run_urlstring (example: https://api.github.com/repos/github/hello-world/actions/runs/5)
started_atstring (date-time)The time that the job started, in ISO 8601 format. (example: 2019-08-08T08:00:00-07:00)
statusstringThe phase of the lifecycle that the job is currently in. (queued, in_progress, completed, waiting, requested, pending) (example: queued)
stepsarraySteps in this job.
urlstring (example: https://api.github.com/repos/github/hello-world/actions/jobs/21)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_jobs_for_workflow_run_attemptselectowner, repo, run_id, attempt_numberper_page, pageLists 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_runselectowner, repo, job_idGets 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_runselectowner, repo, run_idfilter, per_page, pageLists 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.

NameDatatypeDescription
attempt_numberintegerThe attempt number of the workflow run.
job_idintegerThe unique identifier of the job.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
run_idintegerThe unique identifier of the workflow run.
filterstringFilters 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.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

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
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 run_id = '{{ run_id }}' -- required
AND attempt_number = '{{ attempt_number }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;