branches
Creates, updates, deletes, gets or lists a branches resource.
Overview
| Name | branches |
| Type | Resource |
| Id | github.repos.branches |
Fields
The following fields are returned by SELECT queries:
- list_branches
Response
| Name | Datatype | Description |
|---|---|---|
name | string | |
commit | object | |
protected | boolean | |
protection | object | Branch Protection (title: Branch Protection) |
protection_url | string (uri) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_branches | select | owner, repo | protected, per_page, page |
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 |
|---|---|---|
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. |
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." |
protected | boolean | Setting to true returns only branches protected by branch protections or rulesets. When set to false, only unprotected branches are returned. Omitting this parameter returns all branches. |
SELECT examples
- list_branches
Response
SELECT
name,
commit,
protected,
protection,
protection_url
FROM github.repos.branches
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND protected = '{{ protected }}'
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;