Branch
The branch of a GitHub repository. Useful for obtaining information about the last build on a given branch.
If querying using the repository slug, it must be formatted using standard URL encoding, including any special characters.
Attributes
Minimal Representation
Included when the resource is returned as part of another resource.
Name | Type | Description |
---|---|---|
name | String | Name of the git branch. |
Standard Representation
Included when the resource is the main response of a request, or is eager loaded.
Name | Type | Description |
---|---|---|
name | String | Name of the git branch. |
repository | Repository | GitHub user or organization the branch belongs to. |
default_branch | Boolean | Whether or not this is the resposiotry's default branch. |
exists_on_github | Boolean | Whether or not the branch still exists on GitHub. |
last_build | Build | Last build on the branch. |
Additional Attributes
Name | Type | Description |
---|---|---|
recent_builds | [Build] | Last 10 builds on the branch (when `include=branch.recent_builds` is used). |
Actions
Find
This will return information about an individual branch. The request can include either the repository id or slug.
GET
/repo/{provider}/{repository.id}/branch/{branch.name}
Template Variable | Type | Description |
---|---|---|
provider | Unknown | Documentation missing. |
repository.id | Integer | Value uniquely identifying the repository. |
branch.name | String | Name of the git branch. |
Query Parameter | Type | Description |
---|---|---|
include | [String] | List of attributes to eager load. |
GET
/repo/{provider}/{repository.slug}/branch/{branch.name}
Template Variable | Type | Description |
---|---|---|
provider | Unknown | Documentation missing. |
repository.slug | String | Same as {repository.owner.name}/{repository.name}. |
branch.name | String | Name of the git branch. |
Query Parameter | Type | Description |
---|---|---|
include | [String] | List of attributes to eager load. |
GET
/repo/{repository.id}/branch/{branch.name}
Template Variable | Type | Description |
---|---|---|
repository.id | Integer | Value uniquely identifying the repository. |
branch.name | String | Name of the git branch. |
Query Parameter | Type | Description |
---|---|---|
include | [String] | List of attributes to eager load. |
Example:GET /repo/891/branch/master
GET
/repo/{repository.slug}/branch/{branch.name}
Template Variable | Type | Description |
---|---|---|
repository.slug | String | Same as {repository.owner.name}/{repository.name}. |
branch.name | String | Name of the git branch. |
Query Parameter | Type | Description |
---|---|---|
include | [String] | List of attributes to eager load. |
Example:GET /repo/rails%2Frails/branch/master