Create Branch
github.create_branch
ActionBusiness appsconnection required
Calls POST /repos/{owner}/{repo}/git/refs with refs/heads/{branch}.
Create a branch pointing at an existing commit.
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
5 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 new branch. | string | Yes | — | — | release-1.0 |
from_branch Existing branch to start from; its head SHA is looked up first. | string | No | — | — | main |
sha Commit SHA to point at. Used instead of from_branch when set. | string | No | — | — | — |
- At least one of from_branch, sha must be set.
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"branch": "release-1.0",
"from_branch": "main",
"owner": "octocat",
"repo": "hello-world"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
ok True when GitHub accepted the call. | boolean | true |
branch The branch that was created. | string | — |
ref Full ref name, refs/heads/{branch}. | string | — |
sha Commit the branch points at. | string | — |
{
"branch": "",
"ok": true,
"ref": "",
"sha": ""
}Solutions with GitHub
See Create 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.