Get Branch
github.get_branch
ActionBusiness appsconnection required
Calls the GitHub API GET /repos/{owner}/{repo}/branches/{branch}.
Read one branch, including the commit it points at and its protection.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- Bearer token
- Providers
- GitHub
- Secret shape
- the GitHub personal access token
- Resolved by
- config.connection_id, else node.connection_id, else the tenant's sole GitHub connection
Configuration
3 fields, 3 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
owner Repository owner — the user or organisation login. Supports {{ }}. | string | Yes | — | — | octocat |
repo Repository name, without the owner prefix. Supports {{ }}. | string | Yes | — | — | hello-world |
branch Name of the branch to act on, from github.list_branches. | string | Yes | — | — | main |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"branch": "main",
"owner": "octocat",
"repo": "hello-world"
}Output
One shape.
result
The declared fields, plus the rest of the resource as GitHub returned it.
Extra keys beyond the ones listed can appear.
| Field | Type | Example |
|---|---|---|
ok True when GitHub accepted the call. | boolean | true |
name Branch name. | string | — |
commit_sha SHA of the branch head. | string | — |
protected True when branch protection applies. | boolean | — |
{
"commit_sha": "",
"name": "",
"ok": true,
"protected": false
}Solutions with GitHub
See Get Branch run in a workflow.
In a technical demo we add the GitHub connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.