GitHub to Block pull_request_target by Default

Daily Code Guide GitHub News

GitHub plans to block the pull_request_target event by default in affected public repositories on December 2, 2026. The change targets repositories that do not already have an applicable Actions event policy, and it is intended to reduce the risk of running untrusted pull-request code with access to a repository’s privileged workflow context.

For teams that maintain public repositories, the immediate task is to identify workflows that depend on pull_request_target, decide whether the event is still necessary, and either migrate the workflow or create a narrowly scoped policy exception.

What is changing

The announced default policy applies to public repositories using the default event-policy behavior. It does not apply to private or internal repositories, and it does not replace an applicable event policy that is already configured. The change is scheduled for December 2, 2026, and the announcement identifies GitHub Free, Team, and Enterprise Cloud as affected by the announcement. GitHub Enterprise Server is excluded from the announced change.

GitHub is providing an evaluate period before enforcement. During that period, workflow runs continue, while policy insights identify runs that would be blocked once the policy becomes active. This gives repository, organization, and enterprise administrators an opportunity to find affected workflows before a normal development or release process depends on them.

Two scheduled brownouts will provide an additional test of the enforcement behavior:

  • November 9, 2026, from 16:00 to 18:00 UTC
  • November 16, 2026, from 16:00 to 18:00 UTC

During those windows, affected attempts will be blocked and will create failed runs with an error annotation. The workflow itself will not execute. GitHub has documented a generic blocked-run error format, but the exact brownout annotation text and full run payload details are not specified in the supplied documentation.

Ad

Why GitHub is changing the default

pull_request_target runs in the context of the base repository. That context can include the base repository’s GITHUB_TOKEN and repository or organization secrets. If a workflow checks out or executes code controlled by an untrusted fork in that privileged context, the code could expose secrets or compromise the automation pipeline.

This is why allowing the event should be treated as a deliberate policy decision rather than a routine compatibility setting. An allowlist entry does not make the workflow safe by itself. The workflow still needs to avoid executing fork-controlled code in the privileged context and should expose only the permissions and secrets it actually requires.

GitHub’s security guidance for pull_request_target recommends least-privilege token permissions, restricted secrets, isolated self-hosted runners, and caution around cache write access. It also recommends separating untrusted pull-request processing from privileged work whenever possible.

How policies can control the event

Actions policies can restrict which workflow events are permitted. The event rules support explicitly allowing pull_request_target, and policies can be applied at repository, organization, or enterprise scope. They can also target selected workflow paths, which allows administrators to avoid granting a broad exception when only one workflow needs the event.

The workflow execution protection documentation recommends using multiple clearly defined policies instead of relying on one large policy for an entire account. The relevant users are repository administrators, organization owners, and enterprise owners.

For teams managing policy as code or through administrative tooling, GitHub’s Actions policy REST API documentation describes enforcement states including disabled, active, and evaluate. The API also supports event rules containing pull_request_target and workflow-path targeting. The exact configuration should match the narrowest repository, organization, enterprise, and workflow scope that meets the operational need.

Policy insights are available at the applicable GitHub Actions policy scope. They show workflow runs blocked by active policies and runs that would have been blocked by policies in evaluate mode. The supplied documentation does not provide a complete precedence matrix for every combination of enterprise-, organization-, repository-, and workflow-targeted policies, so administrators should validate their configuration in the relevant scope rather than assume how every layered policy will interact.

Migration options for developers

Not every workflow using pull_request_target needs the same replacement. GitHub documents pull_request as a potentially safer alternative when the workflow does not need additional secret access. That option should not be treated as a universal replacement; suitability depends on the workflow’s authentication, secret, and privilege requirements.

For more complex automation, a split design may be appropriate. One part of the process can handle untrusted pull-request data without privileged access, while a separate, controlled step performs the privileged operation. The supplied guidance does not prescribe one migration pattern for every workflow, so teams should review what each job checks out, builds, tests, fetches, uploads, or otherwise executes.

Workflows that continue using pull_request_target should be reviewed for fork-controlled content in checkout, dependency installation, build, test, artifact, and fetch steps. They should also use minimal GITHUB_TOKEN permissions, limit exposed secrets, and avoid placing untrusted code on a self-hosted runner with access to sensitive systems. Where self-hosted runners are required, GitHub’s guidance supports using isolated and ephemeral runners.

What you should do before December 2

  1. Review policy insights. Use evaluate-mode insights to locate runs that would be blocked after enforcement.
  2. Inventory the affected workflows. Pay particular attention to public repositories without an applicable event policy and workflows triggered by pull requests from forks.
  3. Confirm whether the event is necessary. If the workflow does not need additional secret access, evaluate whether pull_request is suitable.
  4. Separate trust levels where possible. Keep untrusted pull-request processing away from secret-accessing or otherwise privileged work.
  5. Review privileged workflow behavior. Check checkout, dependencies, builds, tests, artifacts, caches, and runner selection for ways fork-controlled content could execute or gain access to sensitive resources.
  6. Create a narrow policy exception if required. If pull_request_target remains necessary, configure an applicable Actions event policy that explicitly permits it and target the required workflow path where possible.
  7. Test during the brownouts. Use the November 9 and November 16 windows as additional opportunities to identify operational dependencies, while noting that exact annotation wording is not documented.

Availability and remaining limits

The default policy is limited to public repositories. Private and internal repositories are excluded from this announced default behavior. The workflow execution protection feature is documented as available for all public repositories and for private repositories on GitHub Team or GitHub Enterprise, while evaluate enforcement is documented as a GitHub Enterprise Cloud feature.

The announcement describes the default block broadly, while the detailed guidance qualifies it: the default policy applies where no applicable event policy already exists and does not replace an applicable policy. GitHub’s supplied documentation does not fully describe every possible policy-precedence combination or provide a universal interface walkthrough for creating the narrowest exception. Teams should therefore verify the effective policy at the repository, organization, or enterprise scope that controls the workflow.

Sources

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top
Ad
Ad
Ad