fork-pr-safety
/fork-pr-safety
Use when a pull request comes from a fork, when its workflow runs show "approval required" or are waiting for a maintainer, when deciding whether to approve CI on a contributor's PR, when a fork PR's branch is out of date, when DCO fails on a contributor's commit or you're about to click Commit suggestion on one, or when checking whether a repo's workflows are safe for PRs from forks.
- Author
- getgithard ↗
- Repository
- githard ↗
- Licence
- MIT
- Last repository change
- 10.11.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 10.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: approve-runs.sh
What it does and when to use it
Use when a pull request comes from a fork, when its workflow runs show "approval required" or are waiting for a maintainer, when deciding whether to approve CI on a contributor's PR, when a fork PR's branch is out of date, when DCO fails on a contributor's commit or you're about to click Commit suggestion on one, or when checking whether a repo's workflows are safe for PRs from forks.
Triggers from the description
Original author description
Use when a pull request comes from a fork, when its workflow runs show "approval required" or are waiting for a maintainer, when deciding whether to approve CI on a contributor's PR, when a fork PR's branch is out of date, when DCO fails on a contributor's commit or you're about to click Commit suggestion on one, or when checking whether a repo's workflows are safe for PRs from forks.
How it works
- Before CI runs
- Never
- When the contributor pushes again
- DCO failures
- Checking an existing repo
SKILL.md preview
---
name: fork-pr-safety
description: Use when a pull request comes from a fork, when its workflow runs show "approval required" or are waiting for a maintainer, when deciding whether to approve CI on a contributor's PR, when a fork PR's branch is out of date, when DCO fails on a contributor's commit or you're about to click Commit suggestion on one, or when checking whether a repo's workflows are safe for PRs from forks.
---
# Fork PR safety
Approving CI on a PR from a fork runs a stranger's code on your runners. Most of the time that's fine. What protects you is reading the diff first, every time, and approving only the commit you read.
The reasons behind each step are in `${CLAUDE_PLUGIN_ROOT}/knowledge/lessons.md` (Fork PRs and CI safety).
## Before CI runs
1. **Get the full diff reviewed.** Dispatch the `fork-pr-reviewer` agent with the repo and the PR number, or with the diff file if that's what you have. It reads every line and returns a verdict. If you can't dispatch it, read `gh pr diff <N>` yourself, all of it, against the same list in `${CLAUDE_PLUGIN_ROOT}/agents/fork-pr-reviewer.md`.
2. **Act on the verdict.**
- `SAFE TO RUN CI`: approve the runs (step 3).
- `OWNER MUST REVIEW`: anything under `.github/`, anything near secrets, or code that runs in CI goes to the owner. Give them the PR link and the findings, and don't approve until they say yes.
- `DON'T RUN CI`: don't approve. Tell the owner what was found.
3. **Approve only the runs on the PR's current head commit:**
```sh
bash ${CLAUDE_SKILL_DIR}/approve-runs.sh OWNER/REPO <N> --head <SHA>
```
`<SHA>` is the head commit the review read (`gh pr view <N> --json headRefOid`). If someone pushed since, the script refuses, and the runs on the new commit wait for a look.
## Never
- **Never push to a contributor's branch, and never click "Update branch" for them.** If branch protection is on, a push the author didn't make needs another approval, and the owner can't approve their own push, so the PR deadlocks. Ask the contributor to click **Update branch** instead.
- **Never use "Commit suggestion" in a repo that requires DCO.** The commit it makes has no sign-off, and DCO fails. Leave the suggestion as a comment and let the contributor commit it with `git commit -s`.
- **Never run a merge script on a fork PR** that might rebase or update its branch.
## When the contributor pushes again
A push dismisses approvals and puts CI back to waiting. Have the agent review the PR again, approve the runs on the new head, and re-approve the PR if it needs a review.
## DCO failures
If DCO fails on their commit, ask them to add the sign-off and force-push:
```sh
git commit --amend -s --no-edit && git push --force-with-lease
```
For more than one commit, they can use `git rebase --signoff main`. Don't fix it for them, because you'd be pushing to their branch.
## Checking an existing repo
For a repo that's already running, check two things and offer to fix both.
- **Who needs approval.** `gh api repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval`. GitHub's default, `first_time_contributors`, stops asking once someone has had a PR merged, so later PRs run without anyone reading the diff. Recommend `all_external_contributors`: `gh api -X PUT repos/OWNER/REPO/actions/permissions/fork-pr-contributor-approval -f approval_policy=all_external_contributors`.
- **`pull_request_target` workflows.** These run with the base repo's secrets and a write token. One that also checks out the PR's head code (`ref: ${{ github.event.pull_request.head.sha }}`, or the head ref) runs a stranger's code with your secrets. Flag every such workflow for the owner, and suggest moving it to `pull_request`.
Files in this package (2)
- SKILL.md 4 KB
- approve-runs.sh 1 KB
Versions
The database has no other skills named fork-pr-safety.
Database snapshot: 13.11.2026 · package version 65944b9a8d94 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Similar skills
- 100recreate-fork-pr
Recreate a pull request from a fork of agentic-seo-check as a branch of the repository, so CI runs on it and it can merge, with the contributor credited. Use when a fork's pull request has no `CI / verify` check, when asked to recreate or bring over a fork's PR, or when its… - 100recreating-fork-prs
Re-creates a reviewed pull request from a fork on a branch in PostHog/posthog, so it can get the required checks and merge, while the contributor stays the commit author and GitHub credits them on the squash commit. Use when a fork PR fails with "Depot CI does not run fork pull… - 100untrusted-contributor-intake
Safely assess an outside-contributor fork pull request through metadata and diff evidence, then report a maintainer decision without executing untrusted content. Use when screening an outside-contributor fork pull request. - 98triage-contributor-pr
Triage open pull requests from external contributors to prisma/orm and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check… - 100create-contributor-prs
For an external contributor's open PRs to brave/brave-core, ensure the `sync-and-rebase-pr-from-fork.yml` workflow has been dispatched for each PR's latest commit SHA — so a `contributor-*` draft PR exists inside brave/brave-core and CI can run. Invoke when the user says… - 100contributor
End-to-end open source contribution workflow: from scanning issues to submitting PRs. Use this skill whenever the user wants to contribute to an open source project, find issues to fix, submit a pull request, fork a repo to contribute, fix a GitHub issue, or mentions 'open…