Skip to content
30 November 2026 An independent technology publication
Guide

pull_request_target blocked on 2 December: 7 safe fixes for your GitHub workflows

GitHub blocks pull_request_target by default in public repos from 2 December 2026. Find affected workflows and apply 7 safe fixes before your CI breaks.

pull_request_target blocked on 2 December: 7 safe fixes for your GitHub workflows, DevQuarry featured image

From 2 December 2026, GitHub Actions blocks the pull_request_target event by default in public repositories. Any workflow that relies on pull_request_target will stop running unless you migrate it or allow it with an explicit policy. GitHub ran two brownouts on 9 and 16 November to warn maintainers, and many open source projects found broken labelers, preview deploys and comment bots in the process.

The change exists because pull_request_target is the trigger behind the most damaging GitHub Actions attacks of the last few years, including the March 2026 Trivy action compromise. This guide shows how to find every affected workflow, which of seven fixes to apply to each one, and how to keep the trigger where you really need it.

pull_request_target blocked on 2 December: 7 safe fixes for your GitHub workflows, DevQuarry featured image

The short version

  • From 2 December 2026, pull_request_target is blocked by default in public repositories on GitHub Free, Team and Enterprise Cloud.
  • Private and internal repositories and GitHub Enterprise Server are not affected.
  • Until then, the rule runs in evaluate mode, and Insights shows which runs it would block.
  • Most build and test workflows should move to the pull_request trigger.
  • Workflows that need secrets after a fork build should split into pull_request plus workflow_run.
  • Where pull_request_target is truly needed, allow it with an Actions event policy scoped to specific workflow files.

What is changing on 2 December?

GitHub announced on 2 November 2026 that GitHub Actions will block pull_request_target events by default in public repositories, “unless an applicable Actions event policy explicitly allows them.” Enforcement was first planned for 2 November and moved to 2 December to give maintainers more time.

pull_request_target timeline: announcement on 2 November, brownouts on 9 and 16 November from 16:00 to 18:00 UTC, evaluate mode in between, enforcement from 2 December 2026
Date (2026) What happens
2 November GitHub announces the new default rule, in evaluate mode
9 November, 16:00 to 18:00 UTC First brownout: blocked runs fail with an error annotation
16 November, 16:00 to 18:00 UTC Second brownout
Until 2 December Evaluate mode: workflows run, with warnings
From 2 December The block is permanent unless a policy allows the event

Which repositories are affected?

The block applies to public repositories on GitHub Free, GitHub Team and GitHub Enterprise Cloud. Private and internal repositories are not affected, and neither is GitHub Enterprise Server. A repository that already has an Actions event policy covering pull_request_target follows that policy instead of the default.

If your workflows failed with an error annotation during one of the two brownout windows (21:30 to 23:30 IST), that is a preview of what will happen permanently from 2 December.

Why is GitHub blocking pull_request_target?

GitHub is blocking pull_request_target because it runs fork pull requests with the base repository’s privileges. The workflow runs in the context of the target branch, with access to repository secrets and a GITHUB_TOKEN that can have write permission. That is safe only as long as the workflow never runs code from the pull request.

pull_request_target pwn request: a fork pull request triggers a privileged workflow, which checks out the PR head and runs its build script, letting attacker code read secrets and the write token

The dangerous pattern, often called a “pwn request,” looks like this:

  1. An attacker opens a pull request from a fork.
  2. A pull_request_target workflow checks out the pull request’s code.
  3. The workflow runs that code, for example with npm install or a test script.
  4. The attacker’s code reads secrets or uses the write token.

What happened with Trivy?

The best-known recent example is the Trivy action compromise. According to Snyk’s analysis, attackers first exploited a pull_request_target workflow on 28 February 2026 to steal an organisation-scoped personal access token. Credentials survived a rotation, and on 19 March they force-pushed 75 of the 76 version tags of aquasecurity/trivy-action to malicious code that stole secrets from every pipeline using it. StepSecurity detected outbound connections from more than 12,000 public repositories.

One misconfigured pull_request_target workflow led to a supply chain attack on thousands of other projects. That is the risk GitHub is now removing by default. Our guide to GitHub Actions security covers the wider lessons from that attack.

pull_request vs pull_request_target

The two triggers look almost the same in YAML but behave very differently for forks:

pull_request pull_request_target
Code that runs by default The pull request’s merge commit The base branch
Secrets for fork PRs Not available Available
GITHUB_TOKEN for fork PRs Read-only Can have write access
Safe to build fork code? Yes Only if you never run it
Blocked from 2 December in public repos? No Yes, by default

How do I find workflows that use pull_request_target?

Start with three checks. Together they take about ten minutes for a single repository.

Use the Insights view in repository settings

The default rule runs in evaluate mode until 2 December, and GitHub’s Insights view lists the workflow runs it would have blocked. Open Settings, then Actions, and look at the policy insights for the new default rule.

pull_request_target policy insights in GitHub repository settings: the default rule in evaluate mode with a list of workflow runs that would be blocked

This is the most reliable check, because it shows real runs rather than files that might never trigger.

Search your workflow files

Search every workflow file for the trigger:

grep -RIn "pull_request_target" .github/workflows
pull_request_target search in a terminal: grep across .github/workflows finds three workflows, labeler.yml, preview.yml and test.yml

For an organisation, use GitHub code search with org:your-org path:.github/workflows pull_request_target to find every repository at once.

Check reusable workflows and composite actions

A workflow may call a reusable workflow or composite action that does the dangerous part. Follow every uses: line in matching workflows and read what it runs. The AiCybr audit guide also recommends checking workflow_run and issue_comment workflows that fetch code or artifacts from untrusted pull requests.

7 safe fixes for pull_request_target workflows

Each affected workflow needs one of these fixes. Most repositories need only the first two or three.

pull_request_target decision guide: if the workflow runs PR code and needs no secrets use pull_request, if it needs secrets after building use workflow_run, if it only labels or comments keep pull_request_target with a scoped policy

Fix 1: Switch build and test workflows to pull_request

If a workflow builds, tests or lints the pull request and does not need secrets, change the trigger to pull_request. This is the right fix for most workflows that were using pull_request_target by mistake or out of habit.

on:
  pull_request:
    branches: [main]

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - run: npm ci && npm test

With pull_request, fork code runs with a read-only token and no secrets. If it is malicious, it has nothing worth stealing.

Fix 2: Split privileged work into a workflow_run workflow

Some workflows need secrets after building fork code, for example to post test results as a comment or upload a preview build. Split them in two:

  1. A pull_request workflow builds and tests the code, then uploads the result as an artifact.
  2. A workflow_run workflow, which runs in the base repository with secrets, downloads the artifact and does the privileged step.
pull_request_target replaced by a split workflow: an unprivileged pull_request build uploads an artifact, then a privileged workflow_run job validates it and posts a comment
on:
  workflow_run:
    workflows: ["PR build"]
    types: [completed]

permissions:
  pull-requests: write

jobs:
  comment:
    if: github.event.workflow_run.conclusion == 'success'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/download-artifact@v5
        with:
          run-id: ${{ github.event.workflow_run.id }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
      - run: ./scripts/post-comment.sh results.json

Treat the artifact as untrusted input. Never execute it, and validate anything you read from it, such as a pull request number, before using it.

Fix 3: Keep pull_request_target only for metadata tasks

Labelling pull requests, adding a welcome comment or assigning reviewers are legitimate uses of pull_request_target, because they never run the contributor’s code. If you keep a workflow like this:

  • never check out the pull request’s head or merge ref
  • set permissions: to only what the job needs, such as pull-requests: write
  • avoid passing pull request titles or branch names into shell commands without quoting
on:
  pull_request_target:
    types: [opened, synchronize]

permissions:
  contents: read
  pull-requests: write

jobs:
  label:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/labeler@v6

You still need Fix 5 to let it run after 2 December.

Fix 4: Gate deploy previews behind an environment

Preview deployments for forks are the hardest case, because they need secrets and they need to run fork code. The safest option is to stop deploying fork code automatically. Use a workflow_run workflow that deploys only after a maintainer approves, using a GitHub environment with required reviewers. That way a human checks the code before any secret is used with it.

Fix 5: Allow pull_request_target with a scoped event policy

When a workflow truly needs pull_request_target, allow it explicitly. GitHub’s changelog says you can allow the event in an applicable Actions event policy and use workflow file targeting to limit the allowance to specific workflows.

pull_request_target allowed by an Actions event policy: rule allows the pull_request_target event only for .github/workflows/labeler.yml, with enforcement active

Allow only the files you have reviewed, such as .github/workflows/labeler.yml. A repository-wide allow would bring back the risk the default is meant to remove. GitHub’s documentation on controlling workflow execution covers the policy settings.

Fix 6: Review workflow_run and issue_comment workflows too

The block covers only pull_request_target, but the same pwn request pattern can appear in other privileged triggers. Check that:

  • workflow_run workflows never execute downloaded artifacts and validate any values they read from them
  • issue_comment workflows that build code on a “/deploy” or “/test” comment check that the commenter is a maintainer first
  • none of them check out code from a fork and run it

Fix 7: Harden every workflow that keeps privileges

Whatever you keep, reduce what an attacker would get if something goes wrong:

Hardening step Why it helps
Set permissions: per job A stolen token can do less
Pin third-party actions to full commit SHAs A moved tag cannot swap in malicious code
Use environments with required reviewers for secrets A human approves before secrets are exposed
Replace long-lived cloud keys with OIDC Credentials expire after the job
Add CODEOWNERS for .github/workflows/ Workflow changes need a maintainer’s review

Which workflows really need pull_request_target?

Very few. Most workflows that use pull_request_target were copied from an old template or used it to get secrets “just in case.” These are the cases where the trigger still makes sense, and what to keep in mind for each:

Use case Needs pull_request_target? Notes
Building and testing fork code No Use pull_request
Linting and formatting checks No Use pull_request
Adding labels based on changed paths Yes Must not check out PR code
Welcome comments for first-time contributors Yes Comment text must not include unquoted PR data
Posting coverage or test results as a comment No Use pull_request plus workflow_run
Deploying previews of fork code Avoid Use workflow_run with an approval gate
Auto-merging dependency bot PRs Usually no Bots open PRs from the same repository, so pull_request has access to secrets

If a workflow does not appear in the “Yes” rows, migrate it rather than writing a policy exception.

What does a blocked run look like?

A blocked pull_request_target run fails without executing any steps and shows an error annotation in the Actions run summary. During the brownouts, maintainers saw these failures on fork pull requests and on their own pull requests that triggered the event.

pull_request_target blocked run in GitHub Actions: workflow run failed with an annotation saying the event was blocked by the repository's Actions event policy

The wording in the annotation can change, so look for the event name and the word “policy” rather than matching the exact text. If you see it after 2 December, the workflow needs one of the fixes above.

Common pull_request_target migration mistakes

Teams that migrated during the brownouts ran into the same problems again and again:

Mistake What goes wrong Better approach
Switching to pull_request but keeping secret use Steps that need secrets fail for fork PRs Move those steps to a workflow_run job
Allowing pull_request_target for the whole repository Every workflow regains the risky trigger Allow only reviewed workflow files
Checking out github.event.pull_request.head.sha in a kept workflow Brings back the pwn request Do not check out PR code in privileged jobs
Trusting artifact contents in workflow_run An attacker controls the artifact Validate every value, never execute artifacts
Forgetting reusable workflows The dangerous step lives in another file Follow every uses: reference

How do I roll this out across an organisation?

For an organisation with dozens or hundreds of public repositories, treat the pull_request_target change as a small project. Fixing repositories one by one as they break on 2 December is the slow way.

A rollout plan that works:

Step What to do Who
1. Inventory Code search for the trigger across the organisation and export the list Platform or DevOps team
2. Triage Mark each workflow as migrate, split or keep, using the table above Repository owners
3. Templates Publish approved reusable workflows for labelling and result comments Platform team
4. Migrate Replace risky workflows with the templates Repository owners
5. Exceptions Add scoped event policies only for reviewed “keep” workflows Security team
6. Verify Open a test pull request from a fork in each active repository Repository owners

Shared templates do most of the work. If every repository labels pull requests with the same reviewed reusable workflow, you only need to review that one file, and a single scoped policy can cover it.

How do I test a workflow from a fork?

Testing from a fork is the only way to see exactly what outside contributors will experience. Create a fork under a personal account, push a small change, and open a pull request against the main repository. Then check three things:

  1. The pull_request workflows run and report status on the pull request.
  2. No step fails because a secret is missing.
  3. Any workflow_run follow-up job runs after the first workflow finishes and posts its result.

Repeat the test after 2 December to confirm that nothing still depends on pull_request_target without a policy.

Does this affect private repositories?

No. GitHub’s default block applies only to public repositories. Private and internal repositories keep running pull_request_target as before, and GitHub Enterprise Server is not affected.

That does not make the trigger safe in private repositories. If forks are allowed, or contractors can open pull requests, the same pwn request risk applies. The 2026 GitHub Actions security roadmap describes workflow execution policies with an evaluate mode, so expect more of these controls to reach private repositories too. Reviewing them now costs little.

What else is GitHub changing in Actions security?

The pull_request_target default is one piece of a wider plan. GitHub’s 2026 Actions security roadmap, published in March, lists several controls that fit together with it:

Roadmap item What it does Relation to pull_request_target
Workflow execution policies Rulesets that control which events can run and who can trigger them, with an evaluate mode The default block is built on this policy system
Scoped secrets Binds secrets to specific repositories, branches, environments or trusted reusable workflows Limits what a privileged workflow can reach even if it is abused
Secrets permission Moves secret management into a dedicated role, so write access no longer grants it Fewer people and tokens can change secrets
Dependency locking A dependencies: section that pins actions, including transitive ones, to commit SHAs Stops the moved-tag attack used against Trivy
Native egress firewall Monitors and blocks outbound traffic from GitHub-hosted runners Makes it harder to send stolen secrets anywhere

The roadmap gave timelines in months rather than dates, so some of these may already be in preview in your organisation. Check the GitHub changelog before you plan around them. The direction is clear, though: privileged triggers and long-lived secrets are being fenced in, and workflows that rely on broad access will keep running into new defaults.

Checklist before 2 December

Work through this list for each public repository you maintain:

  1. Open the policy insights and note every run the default rule would block.
  2. Run grep -RIn "pull_request_target" .github/workflows and follow reusable workflows.
  3. Move build and test workflows to pull_request (Fix 1).
  4. Split workflows that need secrets after a build into pull_request plus workflow_run (Fix 2).
  5. Keep pull_request_target only for metadata tasks, with no checkout of PR code (Fix 3).
  6. Add a scoped event policy for the workflows you keep (Fix 5).
  7. Pin actions to SHAs and set minimal permissions: everywhere (Fix 7).
  8. Open a test pull request from a fork and confirm everything runs.

If your CI also changed recently because of the runner image update, check our guide to the ubuntu-latest move to Ubuntu 26.04 as well. Both changes landed within weeks of each other.

Frequently asked questions

When is pull_request_target blocked?

From 2 December 2026 in public repositories on GitHub Free, Team and Enterprise Cloud. Before that, GitHub ran brownouts on 9 and 16 November from 16:00 to 18:00 UTC.

Is pull_request_target being removed?

No. The event still exists. It is blocked by default in public repositories unless an Actions event policy explicitly allows it.

How do I allow pull_request_target for one workflow?

Create or edit an applicable Actions event policy that allows the event, and use workflow file targeting to limit it to the workflow you reviewed, such as your labeler.

What should I use instead of pull_request_target?

Use pull_request for building and testing pull request code. If you need secrets afterwards, add a separate workflow_run workflow that handles the privileged step with validated inputs.

Does the block affect pull requests from the same repository?

The default rule blocks the event, not specific authors, so branches in the same repository that trigger pull_request_target are also affected. Same-repository pull requests work fine with pull_request, which gets full access to secrets.

Why was pull_request_target dangerous?

It runs with the base repository’s secrets and write token while responding to pull requests from forks. If the workflow runs code from the pull request, an attacker can steal those credentials.

Was pull_request_target involved in the Trivy attack?

Yes. According to Snyk, attackers exploited a pull_request_target workflow on 28 February 2026 to steal a token, which led to the 19 March compromise of the trivy-action tags.

Does GitHub Enterprise Server block pull_request_target?

No. The default block applies to github.com public repositories only. GitHub Enterprise Server is not affected.

Will Dependabot pull requests break?

Dependabot opens pull requests from branches in the same repository, so they work with the pull_request trigger. Workflows triggered by Dependabot have their own rules for secrets, which use Dependabot secrets rather than Actions secrets, so check those separately if a job needs credentials.

What happens to scheduled or push workflows?

Nothing. The default block affects only the pull_request_target event. Workflows triggered by push, schedule, workflow_dispatch or pull_request keep running as before.

Migrate it before it breaks

The pull_request_target block is one of the rare security changes that is easy to get ahead of. Most workflows need a one-line trigger change, a few need a split into two workflows, and the handful that really need the old behaviour can keep it with a scoped policy. Do the audit this week and test with a fork pull request. Then your CI will keep working on 2 December, and your project will be harder to attack.

About the author Aradhya Chaudhary

Data Scientist | Freelancer | Speaker & Writer skilled in programming, development and building AI/ML backed systems.

More from Aradhya
Keep reading

More in Cloud & DevOps

All of Cloud & DevOps →