capabilities.work

Fork a Repository and Create a Working Branch

A 3-step recipe with GitHub. We can help you get access.

Recipe · 3 steps

Fork a Repository and Create a Working Branch

with GitHub · Software Construction Management

Fork a repository then create a working branch on the fork.

  1. Fork the upstream repository into the authenticated account. The fork is created asynchronously and returns 202 Accepted.
  2. Read the default branch reference on the fork to obtain its tip commit SHA.
  3. Create the working branch on the fork from the default branch tip SHA.
What you'll need to have ready
  • githubToken: A GitHub token with repo scope, passed as a Bearer credential.
  • owner: The account owner of the upstream repository to fork.
  • repo: The name of the upstream repository to fork.
  • defaultBranch: The default branch name of the fork to branch from, without the heads/ prefix.
  • workingBranch: The working branch name to create on the fork, without the heads/ prefix.
For your developer

Arazzo workflow github:fork-and-branch, 3 operations: repos/create-fork → git/get-ref → git/create-ref. Specs on APIs.io.