SATURDAY, DECEMBER 5, 2026 Tech news, minus the noise.
N News Cast
LATEST
Home  /  Dev
Dev

GitHub Is Now Blocking pull_request_target Workflows by Default. Here Is What to Fix

GitHub now blocks pull_request_target workflows by default in affected public repos unless an Actions event policy allows them. Here is what changed, why the trigger is risky, and how to fix your CI.

GitHub Is Now Blocking pull_request_target Workflows by Default. Here Is What to Fix
Source: Romainhk, Wikimedia Commons (CC BY-SA 3.0)

If your public repository uses pull_request_target workflows, December 2 was a deadline you may have missed. GitHub has started blocking pull_request_target workflows by default in affected public repositories, unless an Actions event policy explicitly allows them. If you did not set that policy, your workflows are now failing silently, or will be the next time a pull request triggers them.

This is not a bug. It is a security change GitHub has been warning about, and it targets one of the most misunderstood workflow triggers in the platform. Here is what changed, why it matters, and how to fix it.

What pull_request_target Enforcement Changes

The pull_request_target trigger runs a workflow in the context of the base repository, not the pull request. That means it can access secrets, even when the pull request comes from a fork you have never heard of. It was designed for legitimate cases: commenting on pull requests from forks, labeling them, running checks that need repository secrets.

The problem is that the same power makes it dangerous. A workflow that checks out the pull request's code and then runs it, or passes its data to a script, can hand an attacker the keys to your secrets. GitHub has been tightening the rules around this trigger for years, and the December 2 enforcement is the next step: in affected public repositories, pull_request_target workflows are now blocked by default.

The fix is a policy decision, not a code change. A repository or organization admin must explicitly allow pull_request_target through a GitHub Actions event policy. Without that explicit allow, the workflow does not run. GitHub also shipped a related improvement the same week: the AI usage REST API now returns per-model token counts, so teams using Copilot can see exactly which models are burning their credits.

Why GitHub Is Doing This Now

The trigger has been a known footgun for years. Security researchers have demonstrated the attack pattern repeatedly: a pull request from a fork modifies a workflow-adjacent file, the workflow runs with base repository privileges, and the attacker walks away with a secret. The individual steps are well documented, and the defense has always been careful workflow design.

Careful design does not scale. Most repositories copy workflow files from templates, tutorials, or other repositories, and the security implications of pull_request_target are easy to miss. GitHub's answer is to flip the default: instead of asking every repository owner to understand a subtle security boundary, the platform now requires an explicit decision to opt in.

It is the same logic behind other recent GitHub hardening moves. The platform has been pushing least-privilege tokens, short-lived credentials, and explicit permissions for years. Blocking a powerful trigger by default is the blunt version of that philosophy, and it is the right call for a default, even if it breaks some workflows.

How to Check If You Are Affected

First, find out if you use the trigger. Search your .github/workflows directory for pull_request_target. If it appears anywhere, you are affected. Check both the workflows in your default branch and any workflow files that exist on other branches, since the enforcement applies to the repository.

Second, check whether the workflow is actually needed. The most common legitimate uses are commenting on pull requests, adding labels, and running status checks that need secrets. If your workflow does one of those things without touching the pull request's code, it is probably fine to allow. If it checks out the pull request's code and executes it, or if it passes pull request data into a script, stop and rethink the design before allowing it.

Third, look at what the workflow does with secrets. A pull_request_target workflow that only posts a comment needs no secrets at all. A workflow that deploys a preview environment from fork code is a different animal. The question to ask is simple: if a stranger submitted a malicious pull request, what could this workflow do for them? If the answer makes you uncomfortable, the workflow needs redesigning, not just an allow-list entry.

The Fix, in Order

Start with the audit. List every workflow that uses pull_request_target and write down what each one does, what secrets it touches, and whether it executes code from the pull request. This takes an hour for most repositories and it is the step people skip. Do not skip it.

Next, replace what you can. Many pull_request_target workflows exist for historical reasons. A workflow that only needs to comment or label can often be replaced with the pull_request trigger plus a GitHub App or a separate workflow with explicit permissions. The Astral ty 1.0 release and the SGLang 1.0 launch both shipped with modern CI setups that avoid the trigger entirely, and they are good references for what clean workflows look like.

For the workflows that genuinely need pull_request_target, set the policy explicitly. An organization or repository admin can allow the trigger through the Actions event policy. Document the decision: which workflows are allowed, why they need the trigger, and what review process applies when they change. Treat the allow-list like a firewall rule, not a checkbox.

Finally, harden what remains. Pin your actions to full commit SHAs instead of tags. Never check out pull request code in a pull_request_target workflow unless you have a specific reason and a reviewed design. Never interpolate pull request data into shell commands. And require approval for first-time contributors, which is the single cheapest control GitHub offers.

The enforcement is annoying if it catches you by surprise, but the direction is right. A trigger that hands fork pull requests the keys to your secrets should never have been the quiet default. GitHub is making the risk explicit, and the repositories that treat this as a prompt to audit their workflows will be safer for it. The ones that just flip the allow switch without reading the workflows will be back here in six months, with a worse story to tell.

AS
News Cast Editorial Team

We cover AI, gadgets, startups and security — original reporting and explainers, written by humans, for humans. Got a tip? Reach us via the contact page.