workflow_runs
Creates, updates, deletes, gets or lists a workflow_runs resource.
Overview
| Name | workflow_runs |
| Type | Resource |
| Id | github.actions.workflow_runs |
Fields
The following fields are returned by SELECT queries:
- get_workflow_run_attempt
- get_workflow_run
- list_workflow_runs
- list_workflow_runs_for_repo
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The ID of the workflow run. |
name | string | The name of the workflow run. (example: Build) |
check_suite_id | integer | The ID of the associated check suite. |
check_suite_node_id | string | The node ID of the associated check suite. (example: MDEwOkNoZWNrU3VpdGU0Mg==) |
head_repository_id | integer | |
node_id | string | (example: MDEwOkNoZWNrU3VpdGU1) |
workflow_id | integer | The ID of the parent workflow. |
actor | object | A GitHub user. (title: Simple User) |
artifacts_url | string | The URL to the artifacts for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts) |
cancel_url | string | The URL to cancel the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/cancel) |
check_suite_url | string | The URL to the associated check suite. (example: https://api.github.com/repos/github/hello-world/check-suites/12) |
conclusion | string | (example: neutral) |
created_at | string (date-time) | |
display_title | string | The event-specific title associated with the run or the run-name if set, or the value of run-name if it is set in the workflow. (example: Simple Workflow) |
event | string | (example: push) |
head_branch | string | (example: master) |
head_commit | object | A commit. (title: Simple Commit) |
head_repository | object | Minimal Repository (title: Minimal Repository) |
head_sha | string | The SHA of the head commit that points to the version of the workflow being run. (example: 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d) |
html_url | string | (example: https://github.com/github/hello-world/suites/4) |
jobs_url | string | The URL to the jobs for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/jobs) |
logs_url | string | The URL to download the logs for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/logs) |
path | string | The full path of the workflow (example: octocat/octo-repo/.github/workflows/ci.yml@main) |
previous_attempt_url | string | The URL to the previous attempted run of this workflow, if one exists. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/attempts/3) |
pull_requests | array | Pull requests that are open with a head_sha or head_branch that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. |
referenced_workflows | array | |
repository | object | Minimal Repository (title: Minimal Repository) |
rerun_url | string | The URL to rerun the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/rerun) |
run_attempt | integer | Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. |
run_number | integer | The auto incrementing run number for the workflow run. |
run_started_at | string (date-time) | The start time of the latest run. Resets on re-run. |
status | string | (example: completed) |
triggering_actor | object | A GitHub user. (title: Simple User) |
updated_at | string (date-time) | |
url | string | The URL to the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5) |
workflow_url | string | The URL to the workflow. (example: https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml) |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The ID of the workflow run. |
name | string | The name of the workflow run. (example: Build) |
check_suite_id | integer | The ID of the associated check suite. |
check_suite_node_id | string | The node ID of the associated check suite. (example: MDEwOkNoZWNrU3VpdGU0Mg==) |
head_repository_id | integer | |
node_id | string | (example: MDEwOkNoZWNrU3VpdGU1) |
workflow_id | integer | The ID of the parent workflow. |
actor | object | A GitHub user. (title: Simple User) |
artifacts_url | string | The URL to the artifacts for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts) |
cancel_url | string | The URL to cancel the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/cancel) |
check_suite_url | string | The URL to the associated check suite. (example: https://api.github.com/repos/github/hello-world/check-suites/12) |
conclusion | string | (example: neutral) |
created_at | string (date-time) | |
display_title | string | The event-specific title associated with the run or the run-name if set, or the value of run-name if it is set in the workflow. (example: Simple Workflow) |
event | string | (example: push) |
head_branch | string | (example: master) |
head_commit | object | A commit. (title: Simple Commit) |
head_repository | object | Minimal Repository (title: Minimal Repository) |
head_sha | string | The SHA of the head commit that points to the version of the workflow being run. (example: 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d) |
html_url | string | (example: https://github.com/github/hello-world/suites/4) |
jobs_url | string | The URL to the jobs for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/jobs) |
logs_url | string | The URL to download the logs for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/logs) |
path | string | The full path of the workflow (example: octocat/octo-repo/.github/workflows/ci.yml@main) |
previous_attempt_url | string | The URL to the previous attempted run of this workflow, if one exists. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/attempts/3) |
pull_requests | array | Pull requests that are open with a head_sha or head_branch that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. |
referenced_workflows | array | |
repository | object | Minimal Repository (title: Minimal Repository) |
rerun_url | string | The URL to rerun the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/rerun) |
run_attempt | integer | Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. |
run_number | integer | The auto incrementing run number for the workflow run. |
run_started_at | string (date-time) | The start time of the latest run. Resets on re-run. |
status | string | (example: completed) |
triggering_actor | object | A GitHub user. (title: Simple User) |
updated_at | string (date-time) | |
url | string | The URL to the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5) |
workflow_url | string | The URL to the workflow. (example: https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml) |
Response
| Name | Datatype | Description |
|---|---|---|
total_count | integer | |
workflow_runs | array |
Response
| Name | Datatype | Description |
|---|---|---|
id | integer | The ID of the workflow run. |
name | string | The name of the workflow run. (example: Build) |
check_suite_id | integer | The ID of the associated check suite. |
check_suite_node_id | string | The node ID of the associated check suite. (example: MDEwOkNoZWNrU3VpdGU0Mg==) |
head_repository_id | integer | |
node_id | string | (example: MDEwOkNoZWNrU3VpdGU1) |
workflow_id | integer | The ID of the parent workflow. |
actor | object | A GitHub user. (title: Simple User) |
artifacts_url | string | The URL to the artifacts for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/rerun/artifacts) |
cancel_url | string | The URL to cancel the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/cancel) |
check_suite_url | string | The URL to the associated check suite. (example: https://api.github.com/repos/github/hello-world/check-suites/12) |
conclusion | string | (example: neutral) |
created_at | string (date-time) | |
display_title | string | The event-specific title associated with the run or the run-name if set, or the value of run-name if it is set in the workflow. (example: Simple Workflow) |
event | string | (example: push) |
head_branch | string | (example: master) |
head_commit | object | A commit. (title: Simple Commit) |
head_repository | object | Minimal Repository (title: Minimal Repository) |
head_sha | string | The SHA of the head commit that points to the version of the workflow being run. (example: 009b8a3a9ccbb128af87f9b1c0f4c62e8a304f6d) |
html_url | string | (example: https://github.com/github/hello-world/suites/4) |
jobs_url | string | The URL to the jobs for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/jobs) |
logs_url | string | The URL to download the logs for the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/logs) |
path | string | The full path of the workflow (example: octocat/octo-repo/.github/workflows/ci.yml@main) |
previous_attempt_url | string | The URL to the previous attempted run of this workflow, if one exists. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/attempts/3) |
pull_requests | array | Pull requests that are open with a head_sha or head_branch that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. |
referenced_workflows | array | |
repository | object | Minimal Repository (title: Minimal Repository) |
rerun_url | string | The URL to rerun the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5/rerun) |
run_attempt | integer | Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. |
run_number | integer | The auto incrementing run number for the workflow run. |
run_started_at | string (date-time) | The start time of the latest run. Resets on re-run. |
status | string | (example: completed) |
triggering_actor | object | A GitHub user. (title: Simple User) |
updated_at | string (date-time) | |
url | string | The URL to the workflow run. (example: https://api.github.com/repos/github/hello-world/actions/runs/5) |
workflow_url | string | The URL to the workflow. (example: https://api.github.com/repos/github/hello-world/actions/workflows/main.yaml) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_workflow_run_attempt | select | owner, repo, run_id, attempt_number | exclude_pull_requests | Gets a specific workflow run attempt. 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_workflow_run | select | owner, repo, run_id | exclude_pull_requests | Gets a specific workflow run. 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. |
list_workflow_runs | select | owner, repo, workflow_id | actor, branch, event, status, per_page, page, created, exclude_pull_requests, check_suite_id, head_sha | List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. 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.This endpoint will return up to 1,000 results for each search when using the following parameters: actor, branch, check_suite_id, created, event, head_sha, status. |
list_workflow_runs_for_repo | select | owner, repo | actor, branch, event, status, per_page, page, created, exclude_pull_requests, check_suite_id, head_sha | Lists all workflow runs for a repository. 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.This endpoint will return up to 1,000 results for each search when using the following parameters: actor, branch, check_suite_id, created, event, head_sha, status. |
force_cancel_workflow_run | insert | owner, repo, run_id | Cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an always() condition on a job.You should only use this endpoint to cancel a workflow run when the workflow run is not responding to POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel.OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
delete_workflow_run | delete | owner, repo, run_id | Deletes a specific workflow run. Anyone with write 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. | |
re_run_job_for_workflow_run | exec | owner, repo, job_id | Re-run a job and its dependent jobs in a workflow run. OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
approve_workflow_run | exec | owner, repo, run_id | Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see "Approving workflow runs from public forks." OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
cancel_workflow_run | exec | owner, repo, run_id | Cancels a workflow run using its id.OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
review_custom_gates_for_run | exec | owner, repo, run_id, environment_name, comment, state | Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "Using environments for deployment." > [!NOTE] > GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments.OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository. | |
re_run_workflow | exec | owner, repo, run_id | Re-runs your workflow run using its id.OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. | |
re_run_workflow_failed_jobs | exec | owner, repo, run_id | Re-run all of the failed jobs and their dependent jobs in a workflow run using the id of the workflow run.OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. |
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. |
workflow_id | | The ID of the workflow. You can also pass the workflow file name as a string. |
actor | string | Returns someone's workflow runs. Use the login for the user who created the push associated with the check suite or workflow run. |
branch | string | Returns workflow runs associated with a branch. Use the name of the branch of the push. |
check_suite_id | integer | Returns workflow runs with the check_suite_id that you specify. |
created | string (date-time) | Returns workflow runs created within the given date-time range. For more information on the syntax, see "Understanding the search syntax." |
event | string | Returns workflow run triggered by the event you specify. For example, push, pull_request or issue. For more information, see "Events that trigger workflows." |
exclude_pull_requests | boolean | If true pull requests are omitted from the response (empty array). |
head_sha | string | Only returns workflow runs that are associated with the specified head_sha. |
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." |
status | string | Returns workflow runs with the check run status or conclusion that you specify. For example, a conclusion can be success or a status can be in_progress. Only GitHub Actions can set a status of waiting, pending, or requested. |
SELECT examples
- get_workflow_run_attempt
- get_workflow_run
- list_workflow_runs
- list_workflow_runs_for_repo
Gets a specific workflow run attempt.
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,
check_suite_id,
check_suite_node_id,
head_repository_id,
node_id,
workflow_id,
actor,
artifacts_url,
cancel_url,
check_suite_url,
conclusion,
created_at,
display_title,
event,
head_branch,
head_commit,
head_repository,
head_sha,
html_url,
jobs_url,
logs_url,
path,
previous_attempt_url,
pull_requests,
referenced_workflows,
repository,
rerun_url,
run_attempt,
run_number,
run_started_at,
status,
triggering_actor,
updated_at,
url,
workflow_url
FROM github.actions.workflow_runs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND run_id = '{{ run_id }}' -- required
AND attempt_number = '{{ attempt_number }}' -- required
AND exclude_pull_requests = '{{ exclude_pull_requests }}'
;
Gets a specific workflow run.
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,
check_suite_id,
check_suite_node_id,
head_repository_id,
node_id,
workflow_id,
actor,
artifacts_url,
cancel_url,
check_suite_url,
conclusion,
created_at,
display_title,
event,
head_branch,
head_commit,
head_repository,
head_sha,
html_url,
jobs_url,
logs_url,
path,
previous_attempt_url,
pull_requests,
referenced_workflows,
repository,
rerun_url,
run_attempt,
run_number,
run_started_at,
status,
triggering_actor,
updated_at,
url,
workflow_url
FROM github.actions.workflow_runs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND run_id = '{{ run_id }}' -- required
AND exclude_pull_requests = '{{ exclude_pull_requests }}'
;
List all workflow runs for a workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. 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.
This endpoint will return up to 1,000 results for each search when using the following parameters: actor, branch, check_suite_id, created, event, head_sha, status.
SELECT
total_count,
workflow_runs
FROM github.actions.workflow_runs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND workflow_id = '{{ workflow_id }}' -- required
AND actor = '{{ actor }}'
AND branch = '{{ branch }}'
AND event = '{{ event }}'
AND status = '{{ status }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND created = '{{ created }}'
AND exclude_pull_requests = '{{ exclude_pull_requests }}'
AND check_suite_id = '{{ check_suite_id }}'
AND head_sha = '{{ head_sha }}'
;
Lists all workflow runs for a repository. 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.
This endpoint will return up to 1,000 results for each search when using the following parameters: actor, branch, check_suite_id, created, event, head_sha, status.
SELECT
id,
name,
check_suite_id,
check_suite_node_id,
head_repository_id,
node_id,
workflow_id,
actor,
artifacts_url,
cancel_url,
check_suite_url,
conclusion,
created_at,
display_title,
event,
head_branch,
head_commit,
head_repository,
head_sha,
html_url,
jobs_url,
logs_url,
path,
previous_attempt_url,
pull_requests,
referenced_workflows,
repository,
rerun_url,
run_attempt,
run_number,
run_started_at,
status,
triggering_actor,
updated_at,
url,
workflow_url
FROM github.actions.workflow_runs
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND actor = '{{ actor }}'
AND branch = '{{ branch }}'
AND event = '{{ event }}'
AND status = '{{ status }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
AND created = '{{ created }}'
AND exclude_pull_requests = '{{ exclude_pull_requests }}'
AND check_suite_id = '{{ check_suite_id }}'
AND head_sha = '{{ head_sha }}'
;
INSERT examples
- force_cancel_workflow_run
- Manifest
Cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an always() condition on a job.
You should only use this endpoint to cancel a workflow run when the workflow run is not responding to POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
INSERT INTO github.actions.workflow_runs (
owner,
repo,
run_id
)
SELECT
'{{ owner }}',
'{{ repo }}',
'{{ run_id }}'
;
# Description fields are for documentation purposes
- name: workflow_runs
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the workflow_runs resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the workflow_runs resource.
- name: run_id
value: {{ run_id }}
description: Required parameter for the workflow_runs resource.
DELETE examples
- delete_workflow_run
Deletes a specific workflow run.
Anyone with write 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.
DELETE FROM github.actions.workflow_runs
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND run_id = '{{ run_id }}' --required
;
Lifecycle Methods
- re_run_job_for_workflow_run
- approve_workflow_run
- cancel_workflow_run
- review_custom_gates_for_run
- re_run_workflow
- re_run_workflow_failed_jobs
Re-run a job and its dependent jobs in a workflow run.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
EXEC github.actions.workflow_runs.re_run_job_for_workflow_run
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@job_id='{{ job_id }}' --required
@@json=
'{
"enable_debug_logging": {{ enable_debug_logging }}
}'
;
Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see "Approving workflow runs from public forks."
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
EXEC github.actions.workflow_runs.approve_workflow_run
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@run_id='{{ run_id }}' --required
;
Cancels a workflow run using its id.
OAuth tokens and personal access tokens (classic) need the repo scope to use this endpoint.
EXEC github.actions.workflow_runs.cancel_workflow_run
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@run_id='{{ run_id }}' --required
;
Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "Using environments for deployment."
> [!NOTE]
> GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint with a private repository.
EXEC github.actions.workflow_runs.review_custom_gates_for_run
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@run_id='{{ run_id }}' --required
@@json=
'{
"environment_name": "{{ environment_name }}",
"comment": "{{ comment }}",
"state": "{{ state }}"
}'
;
Re-runs your workflow run using its id.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
EXEC github.actions.workflow_runs.re_run_workflow
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@run_id='{{ run_id }}' --required
@@json=
'{
"enable_debug_logging": {{ enable_debug_logging }}
}'
;
Re-run all of the failed jobs and their dependent jobs in a workflow run using the id of the workflow run.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
EXEC github.actions.workflow_runs.re_run_workflow_failed_jobs
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@run_id='{{ run_id }}' --required
@@json=
'{
"enable_debug_logging": {{ enable_debug_logging }}
}'
;