DEVELOPMENT · DEVSECOPS

GitHub Actions: secure pull requests before December 2, 2026

GitHub will block pull_request_target by default for affected public repositories. Find risky workflows and migrate without exposing secrets.

What changes

On December 2, 2026, GitHub plans to enforce a default policy blocking pull_request_target workflows in affected public repositories. Until then, evaluation mode allows runs to continue while policy insights show what would be blocked. Test windows are scheduled for November 9 and 16. Private and internal repositories are not covered by this default policy, and an existing applicable Actions event policy takes precedence.

Why is this event risky?

pull_request_target runs in the context of the base repository rather than the external contributor's pull request. It may have access to elevated tokens and secrets. The critical failure happens when a privileged workflow checks out untrusted fork code and executes it through tests, dependency installation or build scripts.

Audit your workflows

  1. Search .github/workflows/ for pull_request_target.
  2. Review GitHub Actions event policies and insights to identify runs that will be blocked.
  3. Check for untrusted checkout, downloaded artifacts, build commands and test scripts.
  4. Review token permissions, accessible secrets and self-hosted runners.

Choose a safer design

For ordinary pull-request tests, use pull_request where possible, without repository secrets and with minimal token permissions. Reserve pull_request_target for genuinely privileged metadata tasks, and never execute untrusted pull-request code in that privileged context. If workflows must be separated, treat artifacts originating from untrusted workflows as untrusted data.

Minimal example

name: PR checks
on:
  pull_request:

permissions:
  contents: read

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: git status --short

Adapt this example to your project's real tests and approved action versions. Do not expose secrets to steps that execute untrusted contributions.

What to do by December 2

If you do not use pull_request_target, no migration is needed for this change. Otherwise, replace the trigger, redesign privilege separation, or explicitly allow the event in a suitable policy only after a security review.

Official references

Updated November 9, 2026.