head_commit_branches
Creates, updates, deletes, gets or lists a head_commit_branches resource.
Overview
| Name | head_commit_branches |
| Type | Resource |
| Id | github.repos.head_commit_branches |
Fields
The following fields are returned by SELECT queries:
- list_branches_for_head_commit
Response
| Name | Datatype | Description |
|---|---|---|
name | string | |
commit | object | |
protected | boolean |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_branches_for_head_commit | select | owner, repo, commit_sha | Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation. Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. |
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 |
|---|---|---|
commit_sha | string | The SHA of the commit. |
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. |
SELECT examples
- list_branches_for_head_commit
Protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see GitHub's products in the GitHub Help documentation.
Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch.
SELECT
name,
commit,
protected
FROM github.repos.head_commit_branches
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND commit_sha = '{{ commit_sha }}' -- required
;