Organisations
A repository's workflow files and deployment environments
Reads the default branch's tree, paths only, and answers the workflow files under .github/workflows and the deployment environments by name.
GET
/orgs/{org}/github/repositories/{id}/workflowsTL;DR
| Question | Answer |
|---|---|
| What does it do? | A repository's workflow files and deployment environments. |
| What does it take? | org, id in the path. |
| What does it return? | Status 200 with a body of type GithubWorkflows. |
| What can go wrong? | 401 not signed in; 403 a member may not (orgs.forbidden), or the plan has no GitHub App (plan.github_app_not_included); 404 no such organisation or repository (github.repository_not_found); 409 the installation is suspended on GitHub (github.suspended); 429 too many requests, or GitHub asked to wait (github.rate_limited); 502 GitHub could not be reached (github.unavailable); 503 the GitHub App is not set up on this server (github.not_configured), or organisations are not. Every failure uses the one error envelope. |
What it does
Reads the default branch's tree, paths only, and answers the workflow files under .github/workflows and the deployment environments by name. Nothing is stored. The owner and an admin, on Pro and Enterprise.
Path parameters
| Field | Type | Required | Description |
|---|---|---|---|
org | string | yes | The organisation's id or its slug. |
id | string | yes | GitHub's id. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | The workflow files and environments. | GithubWorkflows |
| 401 | Not signed in. | ErrorResponse |
| 403 | A member may not (orgs.forbidden), or the plan has no GitHub App (plan.github_app_not_included). | ErrorResponse |
| 404 | No such organisation or repository (github.repository_not_found). | ErrorResponse |
| 409 | The installation is suspended on GitHub (github.suspended). | ErrorResponse |
| 429 | Too many requests, or GitHub asked to wait (github.rate_limited). | ErrorResponse |
| 502 | GitHub could not be reached (github.unavailable). | ErrorResponse |
| 503 | The GitHub App is not set up on this server (github.not_configured), or organisations are not. | ErrorResponse |
Response body
A 200 answer has the type GithubWorkflows.
| Field | Type | Required | Description |
|---|---|---|---|
repository | GithubPickerRepository | yes | |
repository.id | string | yes | GitHub's repository id. |
repository.fullName | string | yes | |
repository.defaultBranch | string | yes | |
workflows | object[] | yes | The workflow files on the default branch, by file name, at most 200. Empty for an empty repository. |
workflows[].path | string | yes | |
workflows[].file | string | yes | |
truncated | boolean | yes | True when the tree was too large to read whole, so only the top level was read and the list may miss files. |
environments | string[] | yes | The deployment environments by name, at most 100. Empty when there are none or GitHub does not let the App read them. |
See also
| Doc | Why |
|---|---|
| API reference | Every endpoint, and the error envelope |
| Schemas | Every request and response type |
| Tool reference | The operations as callable tools |