# 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.

- **Space:** github-ops-public (https://github.com/Tech-Realm/space-github-ops-public/tree/main/fork-pr-flow)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** GITHUB_TOKEN
- **Tools:** gh, git
- **Routes:** gh-cli; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use github-ops-public/fork-pr-flow` or MCP `get_pack github-ops-public/fork-pr-flow`
- **Files:** CHANGELOG.md, code/invite_read.sh, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (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).



---

Canonical URL: https://logicpacks.io/packs/github-ops-public/fork-pr-flow

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
