Skip to main content

GitHub Is Blocking pull_request_target in Public Repos: What Breaks on Dec 2

Updated 8 min readMarkdown
GitHub Is Blocking pull_request_target in Public Repos: What Breaks on Dec 2

If you maintain a public repository on GitHub, there is a date on your calendar whether you put it there or not. On 2 December 2026, GitHub starts blocking the pull_request_target trigger by default in every public repository that has no event policy of its own. Today, 16 November, is the last rehearsal: from 16:00 to 18:00 UTC the block is switched on for real, and any run it catches fails with an error instead of running. The first rehearsal ran on 9 November. After today's window closes, the rule goes back to evaluate mode, where runs continue and GitHub only records which ones it would have blocked, until the permanent switch on 2 December. The changelog gives no start time for that day, only the date.

This is not a small deprecation tucked into a changelog. pull_request_target is the trigger a large share of open-source automation depends on, and the change is GitHub closing a door that has been walked through by real supply-chain attacks. The surprise is not that it is happening. The surprise, for most maintainers, will be discovering how many of their own files use the trigger.

The two triggers, and why they exist

GitHub Actions has two triggers that look almost identical and behave very differently. pull_request runs when someone opens a pull request, and it runs the version of the automation file that comes with the pull request itself, from the merge commit. For a fork, that code is written by someone without write access to your repository, so GitHub takes the keys away: the token is read-only, and other secrets are withheld. pull_request_target also runs when someone opens a pull request, but it runs the automation file from your default branch, with your repository's token and your secrets in reach. The code that runs is yours, so handing it the keys is safe by design.

That split is what makes pull_request_target useful. A fork contributor cannot run code with your secrets, but your own trusted automation still needs to react to their pull request: add a label, leave a comment, run a check that needs a key. The trigger exists for those chores. It is also what makes it dangerous, and the danger is one step, not the trigger itself.

The dangerous step is checking out the pull request's code inside that privileged run and then executing it. The docs call the result a "pwn request", and the shape is short enough to show in full. This is GitHub's own example of what not to do:

# INSECURE. Provided as an example only (from the GitHub docs).
on:
  pull_request_target:
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - run: make test

The checkout alone runs nothing. The next step finishes it: make test executes a Makefile that came from the fork, inside a run that holds your secrets. A contributor who can open a pull request can put anything in that Makefile, and the privileged run will execute it. GitHub's changelog puts the risk in one sentence: "If a workflow executes untrusted code from a fork, that code could compromise your pipeline or steal secrets." That is the whole reason for the December block. The trigger is fine; the pattern of running fork code under it is not, and it has been common enough, in enough repositories, that GitHub is switching the default for everyone at once.

What changes, and what does not

The block covers public repositories on GitHub Free, Team, and Enterprise Cloud. Private and internal repositories are not affected, and neither is GitHub Enterprise Server, the version companies run themselves. If your repository already has an applicable Actions event policy, the default does not replace it; the change only supplies a default where none exists. And the block is a default, not a removal. A repository that genuinely needs the trigger can allow it explicitly through an event policy, scoped to specific files, and keep running exactly as before. The point of the December date is that doing nothing is no longer the same as allowing it.

Until then, the default rule runs in evaluate mode. Runs continue, and the policy insights page in the repository or organisation settings shows which runs would have been blocked. The two brownouts are the only moments before December when the rule actually bites: 9 November, already past, and today, 16 November, 16:00 to 18:00 UTC. During each window, a blocked attempt creates a failed run with an error annotation and does not execute. After the window, warnings resume. If you have never looked at your policy insights page, today is the day to open it, because the second brownout is the last chance to see your own failures before they become permanent.

The safe pattern, checked locally

The fix for most repositories is not a policy change. It is a smaller change to the file itself: stop using the trigger for anything that runs fork code, and keep it only for the narrow jobs it was made for. Here is the safe shape, a label-adding automation that never checks out code at all. I checked it locally with actionlint 1.7.12, which passed it clean:

name: PR label
on:
  pull_request_target:
    types: [opened]
permissions:
  pull-requests: write
jobs:
  label:
    runs-on: ubuntu-latest
    steps:
      - name: Add needs-review label
        uses: actions/github-script@v8
        with:
          script: |
            await github.rest.issues.addLabels({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              labels: ['needs-review']
            })

Three things make this safe, and all three are worth checking in your own files. There is no checkout step, so no fork code ever lands on the runner. The permissions are narrowed to pull-requests: write, the one thing the job needs, instead of the broad default. And nothing the contributor wrote, the title, the body, the branch name, is interpolated into a shell command, so a crafted title cannot become code. A title that reaches a shell command is the same class of mistake as a checked-out Makefile: untrusted text treated as instructions. Route it through a variable, or do not touch it at all.

One honest note about the check I ran: actionlint passed the unsafe example above too. It validates syntax and structure, not security, and the pwn-request shape is perfectly valid YAML. A clean lint result says your file parses. It says nothing about whether the pattern is safe. The only check that catches this is reading the file and asking, for each step, whose code is running here.

What to do before 2 December

The work fits in an evening, and it is mostly inventory. First, find every file that uses the trigger: search .github/workflows for pull_request_target and list what each file does with it. Second, open the policy insights page and see which runs the rule would have blocked; the evaluate-mode warnings are GitHub telling you, in advance, what December will break. Third, sort the list into three piles. Files that only label, comment, or read pull-request metadata stay on the trigger, with no checkout and narrow permissions, like the example above. Files that build or test fork code move to pull_request, accepting that they run without secrets, or split into two parts: an unprivileged run that builds and uploads an artifact, and a privileged run that consumes the artifact without executing it. Files that genuinely need the trigger and cannot move get an explicit event policy allowing them, scoped to those files, so the decision is recorded rather than inherited from a default you never chose.

There is a fourth pile worth admitting to: files nobody remembers writing, left over from a template or a copied example, using the trigger for no reason anyone can now state. Those should lose the trigger entirely. The December block is, among other things, a chance to delete automation nobody owns.

The date itself moved once already. Enforcement was first scheduled for 2 November, and the 2 November changelog entry that announced the new date says so plainly. A moved date is not a cancelled change; the brownouts exist precisely because GitHub expects people to need the warning. After today there are no more rehearsals, only the insights page and sixteen days. The repositories that will break on 2 December are the ones whose owners never looked.

Sources


P.S. Everything I write stays free — that part doesn't change. But if this one was worth something to you, you can buy me a coffee ☕ (one-time or monthly, both work). It covers the API credits and hosting behind these experiments — and honestly, it's also the nudge that gets the next one started on the evenings I'd otherwise skip it. — Salam

Buy me a coffee

No comments yet. Be the first to comment.

More from this blog