GitHub Actions Blocked pull_request_target? Check Why

Trace a blocked pull request check and move Laravel tests to a read-only workflow.

If a GitHub Actions check stopped running on December 2, 2026, open Policy insights and match the blocked event to the workflow file. GitHub now blocks pull_request_target by default in affected public repositories unless an applicable event policy allows it. For a job that tests a contributor’s code, use pull_request with read-only permissions and no production credentials.

GitHub Actions guide to blocked pull_request_target checks

The fastest way to narrow the problem is to ask Did any test step start? A red check alone won’t tell you. If PHPUnit printed a failing assertion, the event policy didn’t stop that run. If GitHub rejected the event before the job began, changing your PHP version won’t fix it.

Which repositories does the December change affect?

GitHub’s December 2 enforcement notice covers public repositories. Private and internal repositories are outside this default rule. Existing applicable event policies still apply. A workflow using the ordinary pull_request event is outside the scope of this particular block.

The distinction matters because pull_request_target runs in the base repository’s context. It can have access to secrets even when a contributor submits changes from a fork. A workflow that reads the number of a pull request to add a label has different needs from one that installs the contributor’s dependencies and runs their tests.

How to tell a policy block from a pending or failed check

  1. Open the pull request and record its latest commit, the missing or failed check name and the time of the update. An earlier green run may belong to a different commit.
  2. Open the check details and look for a policy annotation. In Policy insights, look for the same repository, workflow file and event. Ask a repository or organization administrator to check if you lack access.
  3. Read the on section of that workflow. A file can listen for several events. A successful push run doesn’t prove that the pull request event was allowed.

Did the tests start? Compare Policy insights with the job logs.

  • Policy block confirmed. Review what the workflow actually does before changing the trigger.
  • Waiting for approval. Check the repository’s fork contribution rules. Approval to run a fork workflow and permission to use an event are separate decisions.
  • Expected check never appeared. Compare the required check name with the job name. Inspect branch and path filters. For pull_request, also check for merge conflicts.
  • Job started and failed. Read the first failing step. A Composer platform error belongs in the PHP and Laravel compatibility review. If a database test times out after setup, investigate the queries and indexes it exercises.

What should a Laravel test workflow use?

Suppose a public Laravel package has one workflow that runs PHPUnit and posts a comment with the result. Separate the two tasks. The test job needs the proposed code and a disposable test environment. It usually needs no permission to write a comment. Start by letting the check itself report success or failure.

For the test workflow, the following YAML replaces the event and top-level permission settings. It is a fragment. Keep your existing jobs, PHP matrix and required check names.

on:
  pull_request:
    types: [opened, synchronize, reopened]

permissions:
  contents: read

Preserve any other triggers you still need and review job-level permissions, which can override the top-level setting. Check the checkout step too. A hard-coded default branch could produce a green result without testing the proposed change. For a mergeable pull request, the usual checkout on pull_request tests GitHub’s synthetic merge commit. See the event reference for the differences in commit and branch context.

Use an ephemeral runner, a fresh application key and a disposable database. If Composer needs a private registry token, identify which tests can run without that package. Keep credential-dependent checks in a separate trusted process. Don’t solve a missing token by granting fork tests access to repository secrets.

When does a metadata workflow need an exception?

A labeler or triage bot may need to write to the base repository. Review the entire workflow, including reusable workflows and actions. Keep contributor text as data. The privileged job should never run code, install dependencies or execute artifacts supplied by the pull request.

If an exception is necessary after review, scope it to the specific workflow file and grant only the permissions its task requires. GitHub explains the risks in its guide to using pull_request_target securely. For an AI triage bot, also review the permissions of the generated workflow in Rubic8’s GitHub Agentic Workflows setup guide.

How do you prove the new check tests the right code?

Use a disposable fork and a test pull request. First, add a harmless assertion that deliberately fails. Confirm the required check reports that exact failure. Then correct the assertion and push again. Confirm the same check passes on the new revision. Close the test pull request without merging it.

This two-run test catches a subtle migration error. If both runs pass, the workflow may be checking out the base branch, skipping the test file or reporting a different job. Keep the required check in place while you investigate.

Common questions

Will rerunning the blocked job help?

A retry alone leaves the event policy unchanged. After updating the workflow, test a fresh pull request event and verify the result against the latest revision.

Is contents: read enough to unblock pull_request_target?

No. Token permissions govern what a running job can do. An event policy governs whether the workflow can start. Reducing permissions is useful, but it doesn’t change the policy decision.


Rubic8 Editorial Team

Editorial Team

Rubic8 creates practical guides and free tools for developers, webmasters, and digital publishers. Our fast-changing technical content is reviewed against current primary documentation before publication.

We care about your data and would love to use cookies to improve your experience.