GitHub v3 REST API

Get a workflow

Gets a specific workflow. You can replace workflow_id with the workflow file name. For example, you could use main.yaml. Anyone with read access to the repository can use this endpoint. If the repository is private you must use an access token with the repo scope. GitHub Apps must have the actions:read permission to use this endpoint.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Response

200 application/json

Response

Workflow

A GitHub Actions workflow

idintegerrequired

Example:5

node_idstringrequired

Example:MDg6V29ya2Zsb3cxMg==

namestringrequired

Example:CI

pathstringrequired

Example:ruby.yaml

statestringrequired

Allowed values:activedeleteddisabled_forkdisabled_inactivitydisabled_manually

Example:active

created_atstring(date-time)required

Example:2019-12-06T14:20:20.000Z

updated_atstring(date-time)required

Example:2019-12-06T14:20:20.000Z

urlstringrequired

Example:https://api.github.com/repos/actions/setup-ruby/workflows/5

html_urlstringrequired

Example:https://github.com/actions/setup-ruby/blob/master/.github/workflows/ruby.yaml

badge_urlstringrequired

Example:https://github.com/actions/setup-ruby/workflows/CI/badge.svg

deleted_atstring(date-time)

Example:2019-12-06T14:20:20.000Z

get/repos/{owner}/{repo}/actions/workflows/{workflow_id}
 
200 application/json

Disable a workflow

Disables a workflow and sets the state of the workflow to disabled_manually. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

put
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Response

204

Response

put/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable
 
204

Create a workflow dispatch event

You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must configure your GitHub Actions workflow to run when the workflow_dispatch webhook event occurs. The inputs are configured in the workflow file. For more information about how to configure the workflow_dispatch event in the workflow file, see “Events that trigger workflows.”

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint. For more information, see “Creating a personal access token for the command line.”

post
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Body

application/json
refstringrequired

The git reference for the workflow. The reference can be a branch or tag name.

inputsobject

Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when inputs are omitted.

Response

204

Response

post/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches

Body

{ "ref": "topic-branch", "inputs": { "name": "Mona the Octocat", "home": "San Francisco, CA" } }
 
204

Enable a workflow

Enables a workflow and sets the state of the workflow to active. You can replace workflow_id with the workflow file name. For example, you could use main.yaml.

You must authenticate using an access token with the repo scope to use this endpoint. GitHub Apps must have the actions:write permission to use this endpoint.

put
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Response

204

Response

put/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable
 
204

List workflow runs

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. If the repository is private you must use an access token with the repo scope.

get
{protocol}://{hostname}/api/v3/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs

Query Parameters

actorstring

Returns someone’s workflow runs. Use the login for the user who created the push associated with the check suite or workflow run.

branchstring

Returns workflow runs associated with a branch. Use the name of the branch of the push.

eventstring

Returns workflow run triggered by the event you specify. For example, push, pull_request or issue. For more information, see “Events that trigger workflows.”

statusstring

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 can set a status of waiting or requested. For a list of the possible status and conclusion options, see “Create a check run.”

Allowed values:completedaction_requiredcancelledfailureneutralskippedstalesuccesstimed_outin_progressqueuedrequestedwaiting

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

createdstring(date-time)

Returns workflow runs created within the given date-time range. For more information on the syntax, see “Understanding the search syntax.”

exclude_pull_requestsboolean

If true pull requests are omitted from the response (empty array).

Default:false

Path Parameters

ownerstringrequired
repostringrequired
workflow_idOne Of
required

The ID of the workflow. You can also pass the workflow file name as a string.

Variant 1integer

Response

200 application/json

Response

total_countintegerrequired
workflow_runsarray[object]required

An invocation of a workflow

Show Child Parameters
get/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs
 
200 application/json