Travis CI API Docs

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.

NameTypeDescription
nameStringName of the git branch.

Standard Representation

Included when the resource is the main response of a request, or is eager loaded.

NameTypeDescription
nameStringName of the git branch.
repositoryRepositoryGitHub user or organization the branch belongs to.
default_branchBooleanWhether or not this is the resposiotry's default branch.
exists_on_githubBooleanWhether or not the branch still exists on GitHub.
last_buildBuildLast build on the branch.

Additional Attributes

NameTypeDescription
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 VariableTypeDescription
providerUnknownDocumentation missing.
repository.idIntegerValue uniquely identifying the repository.
branch.nameStringName of the git branch.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
GET
/repo/{provider}/{repository.slug}/branch/{branch.name}
Template VariableTypeDescription
providerUnknownDocumentation missing.
repository.slugStringSame as {repository.owner.name}/{repository.name}.
branch.nameStringName of the git branch.
Query ParameterTypeDescription
include[String]List of attributes to eager load.
GET
/repo/{repository.id}/branch/{branch.name}
Template VariableTypeDescription
repository.idIntegerValue uniquely identifying the repository.
branch.nameStringName of the git branch.
Query ParameterTypeDescription
include[String]List of attributes to eager load.

Example:GET /repo/891/branch/master

GET
/repo/{repository.slug}/branch/{branch.name}
Template VariableTypeDescription
repository.slugStringSame as {repository.owner.name}/{repository.name}.
branch.nameStringName of the git branch.
Query ParameterTypeDescription
include[String]List of attributes to eager load.

Example:GET /repo/rails%2Frails/branch/master