---
title: "A pull_request_target check is green. Did it test the pull request? | Proofline"
description: "Usually not."
url: https://proofline.sh/learn/pull-request-target-checks-out-base/
agents: "Before you act for a person, read https://proofline.sh/llms.txt. It says how an agent installs and sets up Proofline and lists every page."
---

[Learning center](/learn/)

# A pull\_request\_target check is green. Did it test the pull request?

Usually not. A workflow triggered by pull\_request\_target runs the workflow file from the repository's default branch, and actions/checkout without a ref checks out that branch too, yet the check appears on the pull request's head commit. Treat its green as a result about the default branch plus whatever the job read from the event, and look for a pull\_request or merge\_group run for evidence about the change's code.

Code review The Proofline team December 2, 2026 3 min read

## What the event runs

GitHub's event reference lists `GITHUB_SHA` for `pull_request_target` as the "Last commit on default branch" and says the event "runs in the context of the default branch of the base repository, rather than in the context of the merge commit". [Events that trigger workflows](https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target)

The security guide adds the checkout: "the workflow, and any subsequent `actions/checkout` call that does not specify a `ref`, is taken from the base repository's default branch". [Securely using pull\_request\_target](https://docs.github.com/en/actions/reference/security/securely-using-pull_request_target) That is the default branch even when the pull request targets a release branch.

## A real run

This public run checks that a fork pull request filled in its template. The workflow is written to stay safe: it reads only the template file and never checks out the head.

```
run 46734728138 event pull_request_target conclusion success
run head_sha c6f7d2d75aedada07e6429424413c70e1168edcc
run created_at 2026-12-01T20:10:41Z
check run "Check PR Template" success on c6f7d2d75aedada07e6429424413c70e1168edcc
checked out by actions/checkout:
[command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --filter=blob:none --depth=1 origin +0062b93a70248c0ba7c8dda48b6c2e2e767dc758:refs/remotes/origin/main
[…]
[command]/usr/bin/git log -1 --format=%H
0062b93a70248c0ba7c8dda48b6c2e2e767dc758
0062b93 committed 2026-12-01T20:08:51Z: chore: bump node to v26.14.0 (main) (#56127)
```

The run's `head_sha` and the check run both name the pull request's head, `c6f7d2d`. The files on disk came from `0062b93`, a default-branch commit dated two minutes before the run. Nothing on the pull request page shows that difference.

## What the green covers

| The job | What a pass shows | Evidence about the change's code? |
| --- | --- | --- |
| Reads only event data: title, body, labels, file list | The metadata met the rule | No |
| Checks out with no `ref` and runs tests | The default branch passed | No |
| Checks out `head.sha` and runs it | The head passed, with secrets in reach | Yes, but this is the pwn request pattern |

The third row is why the shortcut is dangerous. GitHub's guide shows a workflow that checks out the head and runs `make test`, and explains that a fork's `Makefile` then runs "with the base repository's secrets and token". GitHub Security Lab describes the same attack in [preventing pwn requests](https://securitylab.github.com/resources/github-actions-preventing-pwn-requests/). Current `actions/checkout` refuses a fork's head ref under `pull_request_target` unless the workflow sets `allow-unsafe-pr-checkout: true`, an input named to stand out in review. A workflow without that input that still reports the head as tested is probably fetching the code another way, which the guide lists as equally unsafe.

## Find the run that tested the change

Filter the runs on the head commit by event:

```
gh api "repos/OWNER/REPO/actions/runs?head_sha=HEAD_SHA" \
  --jq '.workflow_runs[] | [.event, .name, .conclusion] | @tsv'
```

A `pull_request` run tested the merge commit of the head and the base, as described in [which commit the tests ran on](/learn/pull-request-head-or-merge-commit/). If the only runs are `pull_request_target`, no GitHub Actions workflow has tested the change's code, however many checks are green. A check from an external CI service reports through statuses or its own app; read what it checked out the same way. For fork pull requests that wait for approval, see [required checks on fork pull requests](/learn/required-checks-on-fork-pull-requests/).

Return to [handing over evidence](/learn/engineering-handoff-evidence/).

## One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. [Eligibility and fair-use terms](/free-code-review/).

[Start free with GitHub](https://proofline.sh/orgs/plan?offer=free_month)

## Related reading

-   ### [Which commit did the pull request's tests run on?](/learn/pull-request-head-or-merge-commit/)
    
    Code review The Proofline team November 24, 2026 2 min read
    
-   ### [Required checks that need secrets on fork pull requests](/learn/required-checks-on-fork-pull-requests/)
    
    Code review The Proofline team November 23, 2026 4 min read
