How to Fix pull_request_target Workflows Before GitHub Blocks Them (2026)
GitHub's default block on pull_request_target starts December 2. Here is how to find affected workflows, choose an event and harden what you keep.
On this page 7 sections
GitHub will block pull_request_target workflows by default in public repositories on December 2, 2026. To fix yours, find every workflow that uses the trigger, switch to the pull_request event where secrets are not needed, and add an explicit Actions event policy for the few workflows that must keep it, scoped by file.
This guide is for maintainers and platform engineers who run public repositories on GitHub Free, Team or Enterprise Cloud. It covers what the block does, how to find affected workflows, how to choose between the two events, and how to harden any workflow you keep. The facts come from GitHub's changelog entry and its documentation, current as of November 21, 2026.
Backtrace covers DevOps and security for working engineers, and this change lands on a trigger that has caused real pipeline compromises. Treat it as a deadline for an audit, not just a settings fix.
What will GitHub block on December 2, 2026?
GitHub will stop workflows triggered by pull_request_target from running in public repositories unless an applicable Actions event policy explicitly allows them. Private and internal repositories are not affected, and neither is GitHub Enterprise Server. Enforcement was first planned for November 2 and then moved.
The rule arrives through workflow execution protections. It started in evaluate mode, so blocked runs still executed and only showed up in policy insights. GitHub then ran two short brownouts to let teams see real failures.
| Date | What happens |
|---|---|
| November 9, 2026, 16:00 to 18:00 UTC | Brownout: blocked runs fail with an error annotation |
| November 16, 2026, 16:00 to 18:00 UTC | Brownout: same behavior, then back to evaluate mode |
| December 2, 2026 | Permanent enforcement on affected public repositories |
The default does not replace a policy you already configured. If your repository has an applicable event policy, that policy decides. Everything else gets the new default, including workflows that use the trigger safely.
That last point is what annoys maintainers. A workflow that only adds labels or assigns reviewers is low risk, but it still stops running. You must allow it on purpose or move it to another trigger.
Why is pull_request_target risky enough to block by default?
The trigger runs in the context of the base repository, so it can read secrets and use a privileged token. The standard pull_request event gives fork contributions a read-only token and no secrets. The difference is the whole story.
The danger starts when a workflow checks out code from a fork and runs it. Build commands such as npm install execute scripts that the contributor controls. A second path is passing pull request titles or branch names into a shell command without escaping.
Socket's coverage of the change notes that variations of this pattern contributed to supply chain incidents involving Nx, PostHog and TanStack. Researchers have called these bugs pwn requests since at least 2021. The rule exists because the same mistake keeps recurring across unrelated projects.
Consider what a stolen token can do. A GITHUB_TOKEN with write scope can push branches, edit releases and change workflow files. Set the permissions key at the top of each workflow to the minimum it needs, and the blast radius of any mistake shrinks with it.
Stolen CI credentials rarely stay in CI. A leaked publish token lets an attacker ship a release under your name. Our walkthrough on auditing npm trusted publishing after the SlugFest flaw shows how to limit what a compromised pipeline can publish.
How do you find every workflow that uses pull_request_target?
Search for the string in each repository's workflow directory, then confirm the results with GitHub's policy insights. Start with a plain text search, because it works on every plan and finds unusual file names.
grep -rn "pull_request_target" .github/workflowsFor an organization, GitHub code search covers many repositories at once. Use a query like org:your-org path:.github/workflows pull_request_target. Organization-wide search also finds repositories that you forgot you had.
Then open Settings, Actions, Policies in a repository or organization. Policy insights list runs that were blocked or would be blocked. Evaluate mode is the useful one, because it shows impact before anything fails.
Availability of evaluate mode is unclear as of this writing. Socket reported on November 17 that GitHub made Actions policies free on all plans, including evaluation and insights. The GitHub documentation page we opened still labeled evaluate mode as Enterprise Cloud only. Check your own Settings page, and fall back to workflow run history if the option is missing.
Remember reusable workflows. A called workflow runs under the event of the workflow that calls it, so a shared file in another repository can carry the dependency without containing the string you searched for. Check the callers of any shared workflow as well.
Write down each hit with three fields: the workflow file, what it does, and whether it checks out fork code. That small table drives every decision in the next section.
Should you switch to pull_request or allow pull_request_target?
Switch to pull_request whenever the workflow does not need secrets or write access. GitHub's guidance says pull_request triggers on the same events and runs the workflow from the merge branch, with protections for forks. Allow pull_request_target only for jobs that truly need base-repository privileges.
GitHub's documentation gives three outcomes for each affected workflow:
- If it does not need the trigger, move it to a safer event such as pull_request.
- If it must keep the trigger, create an Actions event policy that explicitly allows it.
- If you do not want the trigger at all, leave the default policy in place and let it block.
Many jobs fall into the third group. Labelers, stale-issue bots and welcome messages can often use pull_request with a separate trusted workflow for the write step. Splitting untrusted handling from secret access is the pattern the GitHub documentation recommends for complex cases.
When you do allow the trigger, use workflow file targeting. GitHub's changelog says you can allow specific workflows instead of the whole repository. A repo-wide allow turns the default protection into a policy that guards nothing.
How do you harden a pull_request_target workflow you must keep?
Treat checked-out fork code as data, never as something to run. Then limit the token, the secrets and the runner. GitHub's guide to securely using pull_request_target lists four controls that apply whether or not you check out pull request code.
- Give the GITHUB_TOKEN the least privilege and expose only the secrets the job needs.
- Expect read-only cache access, because these workflows cannot write to the default branch cache.
- Use ephemeral, isolated runners if you self-host.
- Remove command injection risks by never interpolating untrusted input into shell commands.
The cache rule is easy to miss. A save step in these workflows now fails with a warning, while the job keeps going. Populate caches from a push-triggered workflow instead, since a write-capable mode brings back the poisoning risk.
Be careful with the actions/checkout opt-out. Since GitHub's June change, that action rejects unsafe fork checkouts unless you set allow-unsafe-pr-checkout: true. The name is deliberately loud so reviewers spot it. Use it only after you confirm that the code is never executed, and note that the check does not cover code fetched with git fetch or gh pr checkout.
Pull request content is untrusted input in every form, and that includes text aimed at AI tools. Our guide to auditing AI coding agent configs for planted instructions covers the same rule for agents that read repository files. If an agent runs inside a privileged workflow, the fork controls its prompt.
What is a safe rollout plan for the December 2 change?
Work through the audit in a fixed order, and finish before December 2. At Backtrace, our editors suggest this sequence because it surfaces the risky workflows before the simple ones.
- List every workflow that uses the trigger across your public repositories.
- Mark each one as safe to move, safe to allow, or unsafe.
- Move the safe ones to pull_request and test them with a fork pull request.
- Write one event policy per allowed workflow file, with the smallest scope.
- Rotate secrets that any unsafe workflow could have exposed.
The last step matters most. A workflow that executed fork code with secrets may already have leaked them. Our guide on checking your repos for the setup.js AI coding agent malware shows what a quick repository sweep for planted scripts looks like.
Keep a short exceptions record in the repository itself. For each allowed workflow, note who approved it, why it needs the trigger, and when to review it again. Six months from now, that note tells a new maintainer whether the exception is still justified.
After December 2, watch for failed runs with a policy error annotation. Each one is either a workflow you forgot or a contributor flow that broke. Decide on each case instead of adding a broad allow to make the red go away.
Conclusion
The December 2 default turns a long-standing foot gun into an explicit decision. Most workflows should move to pull_request. A small number will need a scoped allow policy and the hardening controls above.
Start with the search, sort every hit, and rotate secrets for anything unsafe. Do it this week, while the brownouts are fresh and nothing is failing yet.