deniz.in

Markets

Weather

Loading weather

· via dev.to (home feed)

GitHub Actions will block pull_request_target by default in public repos on December 2

From December 2, 2026, GitHub Actions will block pull_request_target by default in public repositories unless an Actions event policy allows it. Maintainers have three migration paths.

GitHub Actions will block pull_request_target by default in public repos on December 2

What changes, and when

From December 2, 2026, GitHub Actions will refuse to run workflows triggered by pull_request_target in public repositories unless an Actions event policy explicitly permits it. That is the change GitHub has scheduled, as summarised in a dev.to write-up aimed at repository maintainers. Any auto-labeller, first-time-contributor greeter or preview deployment that rides on that trigger will stop running once enforcement begins.

The scope covers public repositories on GitHub Free, GitHub Team and GitHub Enterprise Cloud. Private and internal repositories are unaffected, as is GitHub Enterprise Server. The enforcement date was originally set for November 2 before being pushed back a month.

GitHub rehearsed the change with two brownouts, on November 9 and November 16 between 16:00 and 18:00 UTC. During those windows, affected runs failed with an error annotation; outside them the policy has only been evaluating, so runs still execute but carry a warning. Both rehearsals are already over, which means the next time the rule fires, it stays in force. The only route around the block is an Actions event policy that explicitly allows pull_request_target, configurable at the repository, organisation or enterprise level.

Why pull_request_target is a security problem

The trigger looks almost identical to plain pull_request, and that similarity is the trap. A pull_request workflow runs the workflow file from the pull request's merge commit; for a fork contribution, that code belongs to someone without write access, so GitHub hands the job a read-only token and no secrets. pull_request_target instead runs the workflow from the repository's default branch, with the base repository's GITHUB_TOKEN and access to repository and organisation secrets. That makes it handy for chores like labelling or commenting on fork pull requests, and harmless as long as nothing from the fork actually executes.

The danger appears the moment such a workflow checks out the fork's code and runs it — a pattern GitHub's documentation labels a "pwn request", and one that the dev.to post notes has been behind multiple supply-chain compromises. Execution is broader than an obvious shell step: build scripts, test configuration and npm install lifecycle hooks can all end up running code written by the pull request author, with secrets in reach.

How to find affected workflows

The post's first practical step is a local grep for the trigger string across .github/workflows, or an org-scoped GitHub code search for organisations with many repositories. A dependency-free Node script included in the post goes further, flagging lines that check out the pull request head, fetch a pull request ref, reference the fork's repository, or disable checkout's fork protections. The author cautions that it is a regex pass rather than a security audit: a clean result means "look closer at these files", not "all good". Where available, Actions policy insights list the runs the default rule would have blocked, which is the most accurate inventory — though some maintainers outside Enterprise organisations report not being able to see them.

Three ways to fix each workflow

According to the post, every affected workflow lands in one of three buckets.

  1. If it needs no secrets — tests, linting, type checks, builds — switch the trigger to pull_request and pin permissions to contents: read. For most CI, that is the entire fix.
  2. If it needs secrets but never executes pull request code — labellers, greeting bots, triage jobs — keep pull_request_target and allow it deliberately through an Actions event policy, scoped to the specific workflow file rather than allowed repo-wide just to keep an old workflow green.
  3. If it needs to both run untrusted code and use secrets — think "build the fork's PR, then post a preview link" — split it in two: a pull_request workflow builds and tests the fork's code with no secrets and uploads a small artifact, and a workflow_run job fires afterwards with the permissions it needs, reading that artifact strictly as data.

Why it matters

This is a rare case of GitHub shipping a breaking change on a hard date: after December 2, workflows in public repositories that rely on pull_request_target without a policy exception stop running, and everything downstream of them — labels, comments, preview deploys — goes quiet. For maintainers, the audit costs minutes; missing it costs a silently broken pipeline. More broadly, the change shuts down a well-documented class of supply-chain attack and pushes repositories toward a cleaner split: run untrusted code with no secrets attached, and run privileged jobs that never execute untrusted code.

  • #github-actions
  • #security
  • #ci-cd
  • #devops
  • #supply-chain

Related posts