pull_request_target Blocked on Dec 2: Fix Your Workflows

Flow diagram of the pull_request_target blocked rule: a public repo workflow is checked against an event policy and either runs or fails at startup

From December 2, 2026, GitHub Actions blocks pull_request_target by default in affected public repositories, meaning the ones that rely on the default policy. A workflow that uses the event then fails at startup unless an Actions event policy allows it. If you run a labeler, a triage bot or an authenticated check on fork pull requests, check it before that day.

I tested the policy mechanics on 30 November 2026 in a private throwaway repository, using the policies REST API and a real pull request. Two things surprised me: policies stack instead of replacing each other, and a policy that allows only pull_request_target also blocks your tests. Both are covered below, along with what I could not test.

In this guide:

  • Find which of your workflows the block will stop
  • Keep a workflow running with an event policy scoped to one file
  • Avoid two policy traps that I hit in testing
  • Decide whether to allow the event or move to pull_request

What does the pull_request_target block change on December 2?

GitHub’s changelog says enforcement starts December 2, 2026, for all public repositories. It applies on Free, Team and Enterprise Cloud, not Enterprise Server. Private and internal repositories are not affected by this default rule. A policy you write yourself can still block events in a private repository, as my test shows. The date moved from November 2, and GitHub scheduled two two-hour brownouts, on November 9 and 16, before that.

GitHub’s changelog says a blocked run does not start. You get a failed run with an error annotation, and none of the jobs execute.

The rule is a default policy. It does not replace an event policy you already configured for the repository. The docs page words the scope a little narrower than the changelog. It says GitHub enforces the default for repositories that were on the default policy before general availability. So check your own repository instead of assuming.

Note: Until December 2 the default runs in evaluate mode. Your workflows still run, and Settings → Actions → Policies → Policy insights shows which runs the rule would have blocked.

Which workflows will the block stop?

Only workflows whose on: section lists pull_request_target. Search for it in every public repository you own:

grep -rln "pull_request_target" .github/workflows

In my test repository this printed .github/workflows/label.yml, the one file that uses the event. Run it in an up-to-date checkout of the default branch. An empty result means no matching trigger exists in that checkout. A match can also be a comment, so open each file and confirm the event sits under on:.

The docs name labeling, triage and authenticated status checks as the typical uses. They share one trait: they need a write token or a secret while reacting to a pull request from a fork.

A blocked run can look like a broken workflow file. The workflow not triggering guide lists the other reasons a run never starts.

What does a blocked run look like?

In my test the run ended with the conclusion startup_failure, zero jobs and one error annotation. I reproduced it in a private repository, not under the public default. I created an event policy that allows only push and pull_request, then pushed to a pull request:

Event 'pull_request_target' is not allowed to trigger Actions workflows.
Workflow file: '.github/workflows/label.yml'.

The GitHub CLI is less helpful. gh run view printed “This run likely failed because of a workflow file issue.” That wording sends you to the YAML, not to the policy. The check-runs annotations API returned nothing for this run, so the run page in the browser is where the real message lives.

How do you keep a pull_request_target workflow running?

First list the policies that already apply to the repository, because they layer (see the next section). Then create an event policy that allows pull_request_target and scope it to the one workflow file that needs it. The docs say organization and repository policies add to the ones set above them, so a repository policy cannot loosen an organization or enterprise rule. The REST call below creates the policy. I ran it with gh 2.106.0 against the 2026-03-10 API version, and the docs say a fine-grained token needs the repository “Administration” permission with write access:

gh api -X POST -H "X-GitHub-Api-Version: 2026-03-10" \
  repos/OWNER/REPO/actions/policies --input policy.json
{
  "name": "Allow target for label.yml",
  "enforcement": "active",
  "conditions": {
    "workflow_path": {
      "include": [".github/workflows/label.yml"],
      "exclude": []
    }
  },
  "rules": [
    {
      "type": "restrict_action_events",
      "parameters": { "allowed_events": ["pull_request_target"] }
    }
  ]
}

You can do the same in Settings → Actions → Policies. Pick the events to allow and target the workflow file by path.

The workflow I used is a minimal trigger probe, not real labeling automation: it only echoes a line. It runs from the default branch, holds a narrow token and never checks out the pull request:

name: Label PR
on:
  pull_request_target:
permissions:
  pull-requests: write
jobs:
  label:
    runs-on: ubuntu-latest
    steps:
      - run: echo "labeling PR ${{ github.event.pull_request.number }}"

Why did my tests start failing after I added a policy?

Because an event policy is an allowlist. Anything you leave out of allowed_events stops running for the workflows the policy targets. I hit this in three steps.

First, I created a policy allowing push and pull_request for every workflow. label.yml failed, as expected. Then I added the second policy above, allowing pull_request_target for label.yml. The label workflow still failed, because the first policy also targets it and blocks the event. The policies layer, and a run has to pass all of them.

The fix is to exclude label.yml from the first policy. The update call is PUT. My first attempt used PATCH and returned 404:

gh api -X PUT -H "X-GitHub-Api-Version: 2026-03-10" \
  repos/OWNER/REPO/actions/policies/POLICY_ID --input policy1.json

The update body is the full policy with label.yml added to the exclude list:

{
  "name": "Allow push and pull_request",
  "enforcement": "active",
  "conditions": {
    "workflow_path": {
      "include": ["~ALL"],
      "exclude": [".github/workflows/label.yml"]
    }
  },
  "rules": [
    {
      "type": "restrict_action_events",
      "parameters": { "allowed_events": ["push", "pull_request"] }
    }
  ]
}

The next push ran the label workflow successfully. The docs add that omitting workflow_path on an update keeps the existing targeting.

Third, I deleted the first policy and widened the second one to every workflow. Its only allowed event was pull_request_target. The next push ran the label workflow and failed the unit-test workflow with startup_failure:

Results from my private test repository, one push per row:

Policy setup label.yml (pull_request_target) test.yml (pull_request)
No policy runs runs
Allows push, pull_request blocked runs
Same, plus a second policy for label.yml blocked runs
First policy excludes label.yml runs runs
One policy, pull_request_target only, all workflows runs blocked

Warning: An allowlist policy that targets all workflows and lists only pull_request_target blocks pull_request too. Scope the policy with workflow_path, and list every event the targeted file needs. A scoped file that also has workflow_dispatch or push loses them if you omit them. I tested pull_request, not push.

Should you allow pull_request_target or move off it?

Move off it when you can. For pull requests from forks, the pull_request event runs the merge commit with a read-only token and no secrets, and GitHub applies fork approval policies. That is much safer for fork code. It does not make untrusted code safe on a persistent self-hosted runner. Use it for builds, tests and lint. Allow pull_request_target only when the job needs a write token or a secret and never runs code from the pull request.

The docs name the dangerous pattern. A workflow checks out the pull request head, then builds or tests it with the base repository’s secrets in reach. Anything in that checkout can run: a Makefile, an install script or a config file. This is the “pwn request” that the security best practices guide warns about.

Since actions/checkout v7 (7.0.1 was published on July 20, 2026), the action also refuses to check out fork pull request code under pull_request_target or workflow_run by default. The checkout README documents an allow-unsafe-pr-checkout: true input to opt out.

Warning: Set allow-unsafe-pr-checkout: true only after you confirm the checked-out code is never executed. The docs say the input covers fork pull request refs only. A git fetch of the pull request or a downloaded artifact is not covered.

A decision rule that works in practice:

  1. The workflow only labels, comments or triages. Allow it, scoped to its file, with permissions as narrow as possible.
  2. The workflow builds or tests pull request code. Switch it to pull_request.
  3. It needs secrets and the pull request code. Split it: run the untrusted build under pull_request, then pass results through an artifact that a trusted workflow treats as data.

If you also use the lockfile protection from the same policy feature, the lockfile guide shows how it layers with event rules.

What I did not test

I used one private repository on a personal account, one pull request from a branch in the same repository, and the REST API. Untested: the default policy on a public repository, the Policy insights page in evaluate mode, the brownout behavior, fork pull requests, and the actions/checkout refusal that the v7 README describes. The REST docs say the evaluate enforcement level needs GitHub Enterprise. The API accepted it on my personal private repository, but I did not check whether insights recorded anything. I also did not test whether a blocked pull_request_target run on a public repository looks different from the one above.

Frequently Asked Questions

Q: When does GitHub block pull_request_target by default?
A: On December 2, 2026, for public repositories on Free, Team and Enterprise Cloud that rely on the default policy. Enforcement was first planned for November 2. Private and internal repositories and Enterprise Server are not affected.

Q: How do I keep a pull_request_target workflow running after December 2?
A: Check the policies that already apply, then create or update an Actions event policy that allows pull_request_target and target the workflow file by path. Do it in Settings, Actions, Policies, or with the policies REST API. Scope it to one workflow, and list every event that workflow needs.

Q: Why did my tests fail after I added an event policy?
A: A policy is an allowlist. In my test a policy that allowed only pull_request_target for all workflows made the pull_request test workflow fail at startup. List every event the targeted workflows need, or target only the files that need the exception.

Q: Should I switch from pull_request_target to pull_request?
A: Yes, if the workflow does not need a write token or secrets. The pull_request event runs fork code with a read-only token and no secrets. Keep pull_request_target only for jobs that never run pull request code.

Quick Summary:

  • From December 2, 2026 GitHub blocks pull_request_target by default in affected public repositories, and in my test a blocked run ended as startup_failure
  • Find affected files with grep -rln "pull_request_target" .github/workflows
  • An event policy is an allowlist, and several policies layer, so a run must pass all of them
  • A policy that allowed only pull_request_target for all workflows blocked my pull_request tests
  • Scope each policy with workflow_path, and update one with PUT, not PATCH
  • Prefer pull_request for builds and tests, and allow the event only for jobs that never run pull request code

Run the grep command on your public repositories today and decide for each hit: allow it with a scoped policy or move to pull_request. Doing that before December 2 beats finding out from a failed run.

Related guides

Uncategorized

Leave a Reply