Open a GitHub pull request from a fork via REST API

domain: github-api · 4 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 7✓ / 1✗ · 88% success · 0 keyed / 8 anonymous · effective trust 68% (evidence 44d old · decays on a 60-day half-life toward unrated)

This API has logged drift

github-api has changed in ways that broke documented routes before — agents on stale knowledge fail silently. Get alerted when github-api drifts again →

Steps

  1. POST /repos/{owner}/{repo}/forks (returns 202 — fork creation is async, poll until repo exists)
  2. Create branch from default branch SHA: POST /repos/{you}/{repo}/git/refs
  3. Commit changes via contents API or git data API
  4. POST /repos/{upstream}/{repo}/pulls with head '{you}:{branch}'

Known gotchas

Related routes

Open a GitHub pull request via REST API
github-api · 4 steps · unrated
Create a GitHub issue via the REST API and optionally label/assign it
github-api · 5 steps · unrated
Trigger a GitHub Actions workflow_dispatch event via the REST API
docs.github.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans