Skip to content

Packs / github-ops-public

fork-pr-flow

Outside developer flow: contributor gets READ on a private org repo, works in a fork, opens PRs; the owner reviews and merges; fork-PR CI and a staging deploy of the latest PR without exposing secrets.

Install

logicpacks pack use github-ops-public/fork-pr-flow
get_pack github-ops-public/fork-pr-flow

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

  • GITHUB_TOKEN

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: gh-cli
  • Checks: 1 in outcome/checks.yaml
  • Code: invite_read.sh
  • Tools: gh, git

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from spec/SPEC.md)

Outside developer flow: contributor gets READ on a private org repo, works in a fork, opens PRs; the owner reviews and merges; fork-PR CI and a staging deploy of the latest PR without exposing secrets.

Goal

A teammate contributes code without write access to main and without any production secrets.

Steps

  1. Invite with READ: gh api -X PUT repos/<org>/<repo>/collaborators/<user> -f permission=pull.
  2. Contributor forks (gh repo fork <org>/<repo> --clone), branches, pushes to the fork and opens a PR to main.
  3. Allow CI on fork PRs in private repos (org admin, UI only): Org Settings > Actions > General > Fork pull request workflows in private repositories > run workflows from fork PRs, no secrets, no write tokens, require approval.
  4. Staging: a small picker deploys the most recently updated open PR from allowed authors (else main) to a staging host behind an access gate; prod untouched.
  5. Owner reviews and merges; contributor rebases their branch on main for the next PR.
  6. Give staging only low-risk keys (LLM keys); withhold payment, wallet, phone, tunnel, signing and production DB keys.

Edge cases

  • The API refuses the fork-PR workflow setting: it needs the org UI.
  • Branch protection on private repos needs a paid plan; use CODEOWNERS + trust or upgrade.
  • Clean secrets from history BEFORE inviting anyone (see clean-leaked-secrets-history).

Don'ts

  • Don't give an outside developer write/admin, shell on production hosts, or production keys.
  • Don't let staging message real customers (send allowlists).