GitHub Just Blocked pull_request_target by Default. Don't Rush to Turn It Back On.
The safest response to a broken CI run this week is to change the workflow, not the policy
The most dangerous line in a lot of open source repositories has never looked dangerous. It sits in a YAML file under .github/workflows/, it reads on: pull_request_target, and in the wrong hands it can give strangers your repository secrets.
As of Wednesday, December 2, 2026, GitHub stopped running it by default. GitHub Actions now blocks pull_request_target workflows in affected public repositories unless an Actions event policy (a repo or organization setting that lists which triggers may run) explicitly allows them. Some maintainers will open their Actions tab this week, see a red run on a contributor's pull request, find the setting that turns the trigger back on, and click it.
That click is the mistake. The block points at a real bug, and the bug is not the trigger. It is running someone else's code in the same room as your keys. The fix that actually holds is to split the workflow in two: one half that touches the fork's code and has no secrets, and one half that has secrets and never runs the fork's code.
What changed on December 2
GitHub first scheduled this for November and then pushed enforcement to December 2, running two brownouts on November 9 and 16 so maintainers could see what would break. Here is the scope, in plain terms:
- It applies to public repositories on GitHub Free, Team and Enterprise Cloud.
- Private and internal repositories are not affected, and neither is GitHub Enterprise Server.
- If you already set up an Actions event policy that covers the trigger, yours still wins.
- The docs say enforcement lands on repos "that were using the default pull_request_target policy," so the honest answer to "am I affected?" is to look, not guess.
Blocked runs fail with an error annotation instead of executing. That is the whole visible change. Everything interesting is in why GitHub did it.
Why this trigger was a trap
GitHub Actions has two triggers that fire when someone opens a pull request, and they look almost identical in YAML.
pull_request runs the workflow file from the pull request's merge commit, a version that includes the contributor's changes. If the pull request comes from a fork (a copy of your repo under someone else's account), that code belongs to someone without write access to your repo, so GitHub treats the run as untrusted: a read-only token and no secrets.
pull_request_target flips that. It runs the workflow file from your default branch, the version you control, and because the code is yours, it gets the trusted treatment. Per the docs, the job "receives the base repository's GITHUB_TOKEN and access to repository and organization secrets." That is the same trust a push from a collaborator gets.
Think of it like a building's front desk. pull_request lets a visitor into the lobby but not the offices. pull_request_target sends your own staff member out to deal with the visitor, and your staff member carries a master key. That is safe as long as your staff member only reads the visitor's paperwork. It goes wrong the moment they let the visitor take the key and walk around.
In YAML, letting the visitor take the key looks like this example, which GitHub's docs label insecure:
# INSECURE. From GitHub's docs, for illustration only.
on: pull_request_target
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Test
run: make test
The checkout step pulls the fork's code. Then make test runs a Makefile from the fork, with your secrets and a write-capable token within reach of the job. An attacker doesn't need to touch your workflow file. They just open a pull request whose Makefile, test script, package.json install hook or config file does something extra. GitHub calls this a "pwn request" and says it has been the root cause of multiple supply-chain compromises.
The part that catches experienced people is how little "execution" it takes. The docs spell it out: npm install and npm run build run code, configuration files run code, and dependencies the pull request brings along run code. "Execution does not require an obvious build step."
Why people reach for it anyway
Nobody picks pull_request_target to be reckless. They pick it because it is the only trigger that answers "I need to do something privileged in response to a stranger's pull request." The docs list the honest reasons: labeling, triage, posting authenticated status checks, coverage reports that pull from a private registry.
A lot of modern automation lives in exactly that spot. Any bot that needs a write token to comment on, label or check a fork's pull request is shaped like this. That is why the default block will break real things this week, and why the fastest fix (allow the trigger again) is so tempting.
The fix that holds: split the workflow
GitHub's own guidance puts the answer in one sentence: workflows "can be restructured to separate potentially dangerous handling of pull request code from accessing secrets." Here is what that looks like in practice.
The untrusted half runs on pull_request. It checks out the fork's code, installs, builds, runs the tests, produces whatever report you need. It has no secrets and a read-only token, which is fine, because none of that work needs them. If it saves a result, it uploads it as an artifact, a file the run stores so a later workflow can download it.
The trusted half runs on a trusted event (a pull_request_target that never checks out the fork, or a workflow_run, a trigger that fires when another workflow finishes). It has the token it needs to post the comment, set the label or publish the check. It reads the first half's result as data and never executes anything from it.
One warning from the docs that is easy to skip: a workflow_run workflow "should treat artifacts uploaded by other workflows as untrusted data, since their contents can come from a fork." So the trusted half parses a number or a text file. It does not run a script that came out of the artifact, and it does not interpolate the artifact's text into a shell command.
The result is a workflow where the dangerous question ("what does this stranger's code do?") gets answered in a room with no keys, and the privileged action happens in a room with no stranger's code.
Put this into practice this week
These steps go from lowest effort to most work. Most repos will be done after the first three.
1. Find every workflow that uses the trigger. From the root of your repo:
grep -rln "pull_request_target" .github/workflows/
2. Find the dangerous shape inside those files. The docs list the common ones: checking out the pull request's head or merge ref, pointing repository: at the fork, or fetching the code another way.
grep -rnE "pull_request.head.sha|pull_request.head.ref|refs/pull/|head.repo.full_name|gh pr checkout|git fetch" .github/workflows/
Treat this as a first pass, not a proof. A regex can't catch every way a workflow fetches or runs contributor code (a downloaded artifact, a helper script, a reusable workflow), so open each file from step 1 and read it with one question: does anything from the pull request get executed? A file that matches both greps is the first one to split.
3. Check what GitHub blocked. In the repository, open Settings, then under Actions click Policies, and use Policy insights to see which runs the default rule stopped. The how-to page covers creating a policy. If a workflow genuinely needs the trigger and never runs fork code, scope the allow to that workflow file only, not the whole repository.
4. Move what you can to pull_request. If the workflow only builds and tests and doesn't need secrets, switching the trigger is a one-line change and the problem is gone.
5. Split the rest. For the bot that must comment or label, build the two halves above. Expect this to take an afternoon per workflow, mostly spent moving steps and deciding what the artifact should contain.
6. Shrink what's left. For any workflow that keeps the trigger, set permissions: to the least the job needs. The docs list that first under hardening, and they note that pull_request_target runs already get read-only access to the default branch's cache, so don't opt back into a write-capable cache mode.
7. Turn on scanning so it doesn't come back. The docs recommend CodeQL for GitHub Actions to catch these patterns in review.
What to expect when you run the greps: in small repos, often nothing. In repos with a few years of CI history, usually one or two old workflows that someone copied from a blog post in 2021 and nobody has opened since.
The new escape hatch, and why its name matters
GitHub didn't only block the trigger. The docs describe a new actions/checkout input, allow-unsafe-pr-checkout: true, which you now need before checkout will pull a fork's head ref in this context. GitHub says it is "intentionally named to be easy to spot in code review and static analysis."
That is a good design. If you see that line in a pull request to your workflows, the review conversation should be short: show me the step after checkout, and prove it never runs what it checked out.
It also has a hard edge the docs state plainly: it only covers fork pull request refs. Fetching code with git fetch or gh pr checkout, or running a downloaded artifact, is not covered by the checkout protection at all. The new guardrail catches the most common mistake, not every mistake.
Honest limitations
The default only protects repos that leave it alone. Anyone who adds an event policy allowing pull_request_target is back to relying on their own YAML, and the block gives them no further protection.
Pwn requests are not unique to this trigger. The docs say an issue_comment or workflow_run workflow that fetches and runs a fork's code "is vulnerable in the same way." Moving a bad pattern to a different trigger moves the bug, it doesn't fix it.
Splitting a workflow costs real time and adds moving parts. Two workflows, an artifact handoff and a second trigger are more to maintain than one file, and the artifact itself is a new place to make a mistake.
Scope is still slightly fuzzy from the outside. GitHub's November post said the block would apply to "all public repositories," while the December 2 reminder and the docs talk about "affected" repos on the default policy. The safe reading: check Policy insights rather than assuming you're exempt.
What's actually worth taking away
For years the advice on pull_request_target was a warning in the docs that you had to go looking for. As of this week it is the default behavior, and the decision has moved to you. If a run is blocked, the question to ask is not "how do I allow this?" It is "does this workflow ever run the fork's code while my secrets are loaded?"
If the answer is no, allow that one file and move on. If the answer is yes, or you aren't sure, the red run in your Actions tab is the most useful security report your repo will get this year. Split the workflow, keep the keys in the room without the stranger's code, and leave the default where GitHub put it.
Sources: GitHub changelog, December 2, 2026; GitHub changelog, November 2, 2026; Securely using pull_request_target, GitHub Docs; Governing execution of GitHub Actions workflows, GitHub Docs. All read December 2, 2026.