GitHub Actions Is Blocking pull_request_target by Default: What to Change Before December

Prepare public GitHub repositories for the December 2 pull_request_target protection with safer workflow patterns and a focused migration checklist.

Developer Tools & Security•~8 min read•November 14, 2026•By QZ-L Editorial
#GitHub Actions#CI/CD#Supply Chain Security
Looking for related guides? Start with the qz-l Learning Center and explore more tutorials in this topic cluster.

Public GitHub repositories have a deadline for reviewing one of their most privileged workflow triggers. GitHub says that, beginning December 2, 2026, pull_request_target will be blocked by default unless an applicable Actions event policy explicitly allows it. The change is currently in evaluate mode, and GitHub has used scheduled brownouts to expose workflows that will be affected.

This is not just a settings change. It is an opportunity to separate two jobs that are often mixed together: safely inspecting a pull request and executing code supplied by that pull request. The practical rule is simple: use pull_request for ordinary build and test work, and reserve pull_request_target for small, privileged tasks that do not execute untrusted repository code.

Why pull_request_target is different

The two events have similar names but different trust models.

With pull_request, GitHub runs the workflow from the pull request's merge commit. For a pull request from a fork, the default token is read-only and other repository secrets are withheld. That makes it the normal choice for building and testing proposed code when those jobs do not need privileged credentials.

With pull_request_target, GitHub runs the workflow file from the base repository's default branch. The event has the base repository's security context: it can receive the base repository's GITHUB_TOKEN and access configured secrets. That is useful for trusted automation such as labeling or commenting on a pull request from a fork.

The privileged context is safe only while the workflow continues to execute trusted code. The event becomes dangerous when the workflow checks out the pull request's branch, fetches files from the fork, or downloads an artifact from an untrusted run and then executes it.

The dangerous shape is checkout plus execution

A common mistake looks reasonable at first:

on:
  pull_request_target:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          ref: ${{ github.event.pull_request.head.sha }}
      - run: npm install
      - run: npm test

The checkout itself is not the whole vulnerability. The problem is what follows it. npm install can run lifecycle scripts, and npm test can run scripts defined by the pull request. A Makefile, build configuration, test helper, dependency, or other file can also cause code execution. In this example, those commands run inside a workflow that may have access to the base repository's secrets and a privileged token.

Do not “fix” this pattern by merely hiding a secret from one step. The workflow still has an elevated trust boundary, and future changes can accidentally expose another credential or permission. Remove the need for the privileged trigger or keep untrusted content strictly as data.

First choice: move tests to pull_request

If a job only checks the proposed code, it normally belongs on pull_request:

name: Test pull request

on:
  pull_request:

permissions:
  contents: read

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

This example is illustrative and has not been run as part of this article. Its important property is the trigger and permission boundary, not the package-manager commands. Adapt the install and test steps to the project, and remember that a workflow can still expose risks through third-party actions, scripts, or self-hosted runners.

If the test needs a private registry or another secret, do not automatically switch back to pull_request_target and execute the fork. Instead, ask whether the job can be redesigned so the untrusted test runs without that secret, or split the workflow into separate trusted and untrusted stages.

Keep privileged work narrow

Some pull-request automation genuinely needs write access, such as applying labels or posting a status through the GitHub API. Keep that job metadata-only: do not check out the fork, do not run its build scripts, and do not treat downloaded files from the fork as trusted code.

An intentionally small pattern can look like this:

name: Pull request metadata

on:
  pull_request_target:
    types: [opened, synchronize]

permissions:
  contents: read

jobs:
  inspect:
    runs-on: ubuntu-latest
    steps:
      - name: Print untrusted title as data
        env:
          PR_TITLE: ${{ github.event.pull_request.title }}
        run: |
          printf 'Pull request title: %s\n' "$PR_TITLE"

This example does not check out code or use a secret. Passing the title through an environment variable also avoids inserting an untrusted value directly into a shell script. If the real job needs to comment or label, grant only the specific permission required for that API operation, and use a maintained action or carefully reviewed API call.

For more complex systems, a safer architecture is often two workflows. A pull_request workflow builds and tests the proposed code with restricted credentials. A separate trusted workflow handles a narrow API operation after an explicit review or after receiving a carefully validated result. The exact design depends on the repository, but the boundary should be visible in the workflow files.

What GitHub's default protection changes

GitHub's default event policy applies to affected public repositories that do not already have an applicable event policy. Private and internal repositories are not covered by this default. The policy currently runs in evaluate mode: runs continue, but policy insights identify executions that would be blocked after enforcement.

That means a failed run is not the only signal to inspect. Before December 2:

  1. Open the repository, organization, or enterprise Actions policy area and review policy insights.
  2. Find workflows using pull_request_target and determine whether each one needs the privileged event.
  3. Replace the trigger with pull_request when the job only builds, tests, or analyzes proposed code without secrets.
  4. Refactor jobs that mix metadata operations with code execution.
  5. If an exception is unavoidable, create an applicable event policy and target the smallest possible workflow file.

GitHub's workflow execution protections support event rules, workflow-file targeting, evaluate mode, and policy insights. File targeting matters because allowing one carefully reviewed metadata workflow is very different from allowing every workflow in a repository to use the privileged event.

The announced brownouts were scheduled for November 9 and November 16, from 16:00 to 18:00 UTC. They are useful operational tests, but a repository should not wait for a brownout to discover a dependency on this event.

If an exception is necessary

There are legitimate uses for pull_request_target, but “we need to run tests on fork code with secrets” is a high-risk requirement, not a routine configuration choice. Before allowing it, answer these questions:

  • Can the workflow use pull_request without the secret?
  • Is any pull-request code checked out, fetched, built, installed, or executed?
  • Could a dependency or configuration file execute code indirectly?
  • Are GITHUB_TOKEN permissions limited to the exact API operations required?
  • Is the runner ephemeral and isolated, especially if it is self-hosted?
  • Are caches and artifacts treated as potentially influenced by untrusted input?
  • Are third-party actions reviewed and pinned or covered by the repository's existing dependency controls?

GitHub specifically warns that pull_request_target workflows should not check out, build, or run untrusted pull-request code with access to secrets or a privileged token. It also documents cache restrictions for this low-trust trigger and warns that explicitly enabling cache writes can reintroduce cache-poisoning risk.

An exception should be documented as a security decision. Include the workflow path, the reason the event is required, the permissions it receives, the code it is allowed to inspect, and the review owner. Revisit it when the workflow changes.

Do not confuse this with action lockfiles

GitHub Actions workflow lockfiles and this new default protection solve different problems.

A lockfile makes action dependencies predictable by recording the exact revisions used by a workflow, including transitive action dependencies covered by the lockfile. It helps ensure that a reviewed workflow does not silently resolve a moving tag to different action code.

The pull_request_target protection answers a different question: whether a privileged event is allowed to start the workflow in the first place. A repository can need both controls. Pinning every action does not make it safe to execute attacker-controlled project code with secrets, and blocking the event does not pin the actions used by ordinary CI.

A practical pre-deadline checklist

  • Search .github/workflows/ for pull_request_target.
  • For each match, record whether it checks out or executes pull-request content.
  • Move ordinary tests to pull_request and set minimal permissions.
  • Separate comments, labels, and other privileged API calls from build and test jobs.
  • Review Actions policy insights while the default rule is in evaluate mode.
  • Use workflow-file targeting for any justified exception.
  • Review self-hosted runner isolation, cache behavior, downloaded artifacts, and third-party actions.
  • Recheck the workflow after the December 2 enforcement date.

The goal is not to preserve every existing workflow unchanged. The goal is to make the trust boundary explicit: untrusted pull-request code should be tested with untrusted-code protections, while privileged automation should be short, reviewed, and unable to execute that code.

References

Related Posts

GitHub Actions Workflow Logs: Detect and Respond to Leaked Secrets

Enable GitHub workflow log secret scanning carefully, review preview gaps, and revoke leaked credentials with a practical response checklist.

GitHub Actions Lockfiles: Keep CI Running the Code You Reviewed

Learn how GitHub Actions workflow lockfiles pin direct and transitive actions, how to adopt them safely, and what they do not cover.

npm's January 2027 Publishing Change: Move CI to OIDC or Staged Releases

npm plans to remove direct publishing with granular access tokens in January 2027. Compare OIDC and stage-only releases, plus a migration checklist.