This version of GitHub Enterprise was discontinued on 2023-03-15. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.
Workflows
Use the REST API to interact with workflows in GitHub Actions.
About workflows in GitHub Actions
You can use the REST API to view workflows for a repository in GitHub Actions. Workflows automate your software development life cycle with a wide range of tools and services. For more information, see "GitHub Actions documentation."
These endpoints are available for authenticated users, OAuth apps, and GitHub Apps. Access tokens require repo scope for private repositories and public_repo scope for public repositories. GitHub Apps must have the actions permission to use these endpoints.
List repository workflows
Lists the workflows in a repository. 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.
Parameters for "List repository workflows"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| Query parameters | 
| Name, Type, Description | 
| per_pageintegerThe number of results per page (max 100). Default:  | 
| pageintegerPage number of the results to fetch. Default:  | 
HTTP response status codes for "List repository workflows"
| Status code | Description | 
|---|---|
| 200 | OK | 
Code samples for "List repository workflows"
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/workflowsResponse
Status: 200{
  "total_count": 2,
  "workflows": [
    {
      "id": 161335,
      "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
      "name": "CI",
      "path": ".github/workflows/blank.yaml",
      "state": "active",
      "created_at": "2020-01-08T23:48:37.000-08:00",
      "updated_at": "2020-01-08T23:50:21.000-08:00",
      "url": "https://HOSTNAME/repos/octo-org/octo-repo/actions/workflows/161335",
      "html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335",
      "badge_url": "https://github.com/octo-org/octo-repo/workflows/CI/badge.svg"
    },
    {
      "id": 269289,
      "node_id": "MDE4OldvcmtmbG93IFNlY29uZGFyeTI2OTI4OQ==",
      "name": "Linter",
      "path": ".github/workflows/linter.yaml",
      "state": "active",
      "created_at": "2020-01-08T23:48:37.000-08:00",
      "updated_at": "2020-01-08T23:50:21.000-08:00",
      "url": "https://HOSTNAME/repos/octo-org/octo-repo/actions/workflows/269289",
      "html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/269289",
      "badge_url": "https://github.com/octo-org/octo-repo/workflows/Linter/badge.svg"
    }
  ]
}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.
Parameters for "Get a workflow"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| workflow_idRequiredThe ID of the workflow. You can also pass the workflow file name as a string. | 
HTTP response status codes for "Get a workflow"
| Status code | Description | 
|---|---|
| 200 | OK | 
Code samples for "Get a workflow"
curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/workflows/WORKFLOW_IDResponse
Status: 200{
  "id": 161335,
  "node_id": "MDg6V29ya2Zsb3cxNjEzMzU=",
  "name": "CI",
  "path": ".github/workflows/blank.yaml",
  "state": "active",
  "created_at": "2020-01-08T23:48:37.000-08:00",
  "updated_at": "2020-01-08T23:50:21.000-08:00",
  "url": "https://HOSTNAME/repos/octo-org/octo-repo/actions/workflows/161335",
  "html_url": "https://github.com/octo-org/octo-repo/blob/master/.github/workflows/161335",
  "badge_url": "https://github.com/octo-org/octo-repo/workflows/CI/badge.svg"
}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.
Parameters for "Disable a workflow"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| workflow_idRequiredThe ID of the workflow. You can also pass the workflow file name as a string. | 
HTTP response status codes for "Disable a workflow"
| Status code | Description | 
|---|---|
| 204 | No Content | 
Code samples for "Disable a workflow"
curl -L \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/disableResponse
Status: 204Create 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."
Parameters for "Create a workflow dispatch event"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| workflow_idRequiredThe ID of the workflow. You can also pass the workflow file name as a string. | 
| Body parameters | 
| Name, Type, Description | 
| refstring RequiredThe git reference for the workflow. The reference can be a branch or tag name. | 
| inputsobjectInput 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  | 
HTTP response status codes for "Create a workflow dispatch event"
| Status code | Description | 
|---|---|
| 204 | No Content | 
Code samples for "Create a workflow dispatch event"
curl -L \
  -X POST \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/dispatches \
  -d '{"ref":"topic-branch","inputs":{"name":"Mona the Octocat","home":"San Francisco, CA"}}'Response
Status: 204Enable 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.
Parameters for "Enable a workflow"
| Headers | 
|---|
| Name, Type, Description | 
| acceptstringSetting to  | 
| Path parameters | 
| Name, Type, Description | 
| ownerstring RequiredThe account owner of the repository. The name is not case sensitive. | 
| repostring RequiredThe name of the repository without the  | 
| workflow_idRequiredThe ID of the workflow. You can also pass the workflow file name as a string. | 
HTTP response status codes for "Enable a workflow"
| Status code | Description | 
|---|---|
| 204 | No Content | 
Code samples for "Enable a workflow"
curl -L \
  -X PUT \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/actions/workflows/WORKFLOW_ID/enableResponse
Status: 204