· GitHub Actions · CI/CD · Security
GitHub Actions blocks pull_request_target from 2 December
From 2 December 2026, GitHub Actions blocks pull_request_target in public repositories by default. Here's what breaks, how to check, and safer patterns.

From 2 December 2026, GitHub Actions will block workflows triggered by pull_request_target in public repositories, unless a policy explicitly allows them. If you maintain an open source project, or any public repository with workflows that label, comment on or test pull requests from forks, it's worth ten minutes checking your workflows before then.
What's changing
GitHub announced the change on 2 November. A new default rule blocks the pull_request_target event in public repositories on GitHub Free, Team and Enterprise Cloud. Private and internal repositories aren't affected, and neither is GitHub Enterprise Server. Enforcement was originally planned for 2 November and has moved to 2 December.
Until then the rule runs in evaluate mode: workflows still run, but GitHub records the runs it would have blocked. There are two brownouts, when the block is enforced temporarily: 9 and 16 November, 16:00 to 18:00 UTC. During those windows blocked runs fail with an error annotation instead of executing, so if you saw unexplained workflow failures in that slot, this is why.
Why GitHub is doing this
pull_request_target exists for workflows that need more trust than a pull request from a fork normally gets: adding labels, posting comments or reporting authenticated status checks. To make that possible, it runs in the context of the base repository rather than the pull request. According to GitHub's documentation, the workflow file comes from your default branch, the GITHUB_TOKEN has read and write access, and your repository and organisation secrets are available.
That's fine until the workflow runs code from the pull request. GitHub's own example of the classic "pwn request" looks harmless enough:
# INSECURE: don't copy this
on:
pull_request_target:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Test
run: make test
Here make test runs the Makefile from the pull request, so whoever opened it can run anything they like with your token and secrets. The same applies to installing dependencies (package lifecycle scripts run on install), loading a test runner's config, fetching the pull request with git fetch or gh pr checkout, or running an artifact that a fork's workflow uploaded.
GitHub has been closing these holes in stages. In June, actions/checkout v7 started refusing to check out fork pull request code in pull_request_target workflows, and in workflow_run workflows triggered by pull requests. The protection was backported to the other supported major versions, and opting out needs a deliberately conspicuous allow-unsafe-pr-checkout input. It doesn't cover code fetched in a run step, though, which is part of why the event itself is now blocked by default.
Check whether you're affected
Start by searching your workflows. In a single repository:
grep -rln "pull_request_target" .github/workflows
Across an organisation, the GitHub CLI's code search is quicker than cloning everything:
gh search code "pull_request_target" --owner your-org --extension yml
GitHub also shows the runs the new rule would block. In your repository or organisation settings, go to Actions → Policies; the Policy insights page lists runs that were blocked, or would have been, by each policy.
For each workflow you find, the question is simple: does it really need secrets or write access while handling a pull request from a fork? Usually the answer is no.
Option 1: switch to pull_request
If the workflow only builds, tests or lints, it doesn't need pull_request_target at all. The pull_request event runs against the merge commit with a read-only token and no secrets for forks, which is exactly what you want for untrusted code:
on: pull_request
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- run: make test
Option 2: split untrusted work from privileged work
If you need to do something privileged with the result, such as commenting a test report on the pull request, split it into two workflows. The first runs the untrusted code with no secrets and uploads its output; the second is triggered by workflow_run, has write access, and only ever reads that output as data:
# .github/workflows/pr-build.yml
name: pr-build
on: pull_request
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- run: make test > report.txt 2>&1 || true
- env:
PR_NUMBER: ${{ github.event.number }}
run: echo "$PR_NUMBER" > pr-number.txt
- uses: actions/upload-artifact@v4
with:
name: pr-result
path: |
report.txt
pr-number.txt
# .github/workflows/pr-comment.yml
on:
workflow_run:
workflows: [pr-build]
types: [completed]
permissions:
actions: read
pull-requests: write
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: pr-result
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ github.token }}
- env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: |
pr=$(cat pr-number.txt)
[[ "$pr" =~ ^[0-9]+$ ]] || { echo "Unexpected PR number"; exit 1; }
gh pr comment "$pr" --body-file report.txt
The important part is treating the artifact as untrusted: a fork can change the first workflow, so validate everything you read from it (like the PR number above) and never execute or source it.
Option 3: keep it, deliberately
Some workflows genuinely need pull_request_target, such as a labeller that never touches the pull request's code. For those, you can allow the event again with an Actions policy in your repository or organisation settings (Actions → Policies), scoped to the specific workflow file rather than the whole repository. GitHub's workflow execution documentation covers the options, including restricting which events and actors can trigger a workflow.
If you do keep it, harden the workflow: set the smallest permissions block that works, don't check out or run pull request code, and never interpolate pull request fields such as titles or branch names straight into a run step. Pass them through environment variables instead, so they can't inject shell commands:
on: pull_request_target
permissions:
contents: read
pull-requests: write
jobs:
triage:
runs-on: ubuntu-latest
steps:
- env:
TITLE: ${{ github.event.pull_request.title }}
run: echo "Title length: ${#TITLE}"
What I'd do
- Search every public repository for
pull_request_targetthis week, and check Policy insights for runs that would be blocked. - Move build, test and lint jobs to
pull_request; most don't need anything more. - Split anything that needs secrets or write access into a
pull_requestplusworkflow_runpair. - Only re-allow
pull_request_targetfor named workflows that never run pull request code, and give them minimal permissions. - While you're in there, add an explicit
permissionsblock to every workflow, so the default token is never broader than it needs to be.
The block is a sensible default. Most workflows that use pull_request_target don't need it, and the ones that do are worth a second look anyway.
Sources
- pull_request_target blocked by default December 2 (GitHub Changelog, 2 November 2026)
- Securely using pull_request_target (GitHub Docs)
- Controlling workflow execution (GitHub Docs)
- Safer pull_request_target defaults for GitHub Actions checkout (GitHub Changelog, 18 June 2026)
- What pull_request_target runs with, and how to use it without a pwn request (DEV Community), which the split-workflow example is adapted from