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.

FieldTypeRequiredDefaultConstraintsExample
owner
Repository owner — the user or organisation login. Supports {{ }}.
stringYes——octocat
repo
Repository name, without the owner prefix. Supports {{ }}.
stringYes——hello-world
branch
Name of the new branch.
stringYes——release-1.0
from_branch
Existing branch to start from; its head SHA is looked up first.
stringNo——main
sha
Commit SHA to point at. Used instead of from_branch when set.
stringNo———
  • 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

FieldTypeExample
ok
True when GitHub accepted the call.
booleantrue
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": ""
}

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.