GitHub · Arazzo Workflow

GitHub Fork a Repository and Create a Working Branch

Version 1.0.0

Fork a repository, resolve the fork's default branch tip, and create a working branch.

1 workflow 2 source APIs 1 provider
View Spec View on GitHub CodePipelinesPlatformSoftware DevelopmentSource ControlT1ArazzoWorkflows

Provider

github

Workflows

fork-and-branch
Fork a repository then create a working branch on the fork.
Forks the upstream repository, reads the fork's default branch tip, and creates a working branch from it.
3 steps inputs: defaultBranch, githubToken, owner, repo, workingBranch outputs: forkName, forkOwner, workingRef
1
forkRepository
Fork the upstream repository into the authenticated account. The fork is created asynchronously and returns 202 Accepted.
2
getForkDefaultRef
Read the default branch reference on the fork to obtain its tip commit SHA.
3
createWorkingBranch
Create the working branch on the fork from the default branch tip SHA.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: GitHub Fork a Repository and Create a Working Branch
  summary: Fork a repository, resolve the fork's default branch tip, and create a working branch.
  description: >-
    The contributor onboarding pattern. The workflow forks a repository into the
    authenticated account, reads the default branch reference on the fork to
    obtain its tip commit, and then creates a working branch on the fork from
    that commit. Forking is asynchronous on GitHub, so the fork step accepts the
    documented 202 Accepted response. Every step spells out its request inline so
    the flow can be read and executed without opening the underlying OpenAPI
    description.
  version: 1.0.0
  x-realizes-capability-ids:
  - BC-4200.40
  x-capability-derivation:
    method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
    min_confidence: 0.7
    sources:
    - capability_id: BC-4200.40
      capability_name: Software Construction Management
      spec: github-repos-api-openapi.yml
      confidence: 0.75
    model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: gitApi
  url: ../openapi/github-git-api-openapi.yml
  type: openapi
- name: reposApi
  url: ../openapi/github-repos-api-openapi.yml
  type: openapi
workflows:
- workflowId: fork-and-branch
  summary: Fork a repository then create a working branch on the fork.
  description: >-
    Forks the upstream repository, reads the fork's default branch tip, and
    creates a working branch from it.
  inputs:
    type: object
    required:
    - githubToken
    - owner
    - repo
    - defaultBranch
    - workingBranch
    properties:
      githubToken:
        type: string
        description: A GitHub token with repo scope, passed as a Bearer credential.
      owner:
        type: string
        description: The account owner of the upstream repository to fork.
      repo:
        type: string
        description: The name of the upstream repository to fork.
      defaultBranch:
        type: string
        description: The default branch name of the fork to branch from, without the heads/ prefix.
      workingBranch:
        type: string
        description: The working branch name to create on the fork, without the heads/ prefix.
  steps:
  - stepId: forkRepository
    description: >-
      Fork the upstream repository into the authenticated account. The fork is
      created asynchronously and returns 202 Accepted.
    operationId: repos/create-fork
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.githubToken
    - name: owner
      in: path
      value: $inputs.owner
    - name: repo
      in: path
      value: $inputs.repo
    requestBody:
      contentType: application/json
      payload:
        default_branch_only: true
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      forkOwner: $response.body#/owner/login
      forkName: $response.body#/name
  - stepId: getForkDefaultRef
    description: >-
      Read the default branch reference on the fork to obtain its tip commit
      SHA.
    operationId: git/get-ref
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.githubToken
    - name: owner
      in: path
      value: $steps.forkRepository.outputs.forkOwner
    - name: repo
      in: path
      value: $steps.forkRepository.outputs.forkName
    - name: ref
      in: path
      value: "heads/$inputs.defaultBranch"
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      tipSha: $response.body#/object/sha
  - stepId: createWorkingBranch
    description: >-
      Create the working branch on the fork from the default branch tip SHA.
    operationId: git/create-ref
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.githubToken
    - name: owner
      in: path
      value: $steps.forkRepository.outputs.forkOwner
    - name: repo
      in: path
      value: $steps.forkRepository.outputs.forkName
    requestBody:
      contentType: application/json
      payload:
        ref: "refs/heads/$inputs.workingBranch"
        sha: $steps.getForkDefaultRef.outputs.tipSha
    successCriteria:
    - condition: $statusCode == 201
    outputs:
      workingRef: $response.body#/ref
  outputs:
    forkOwner: $steps.forkRepository.outputs.forkOwner
    forkName: $steps.forkRepository.outputs.forkName
    workingRef: $steps.createWorkingBranch.outputs.workingRef

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/github-fork-and-branch-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.