fleetlint Policy for a fleet of repositories
v0.3
Getting started

ci/no-pull-request-target

pull_request_target never runs untrusted code

Severityerror
Tiersall
Stacksany
Scoperoot
Kindexpr
Sourcelibrary v0.0.0-20261011205826-ecb4e9b3ffd4
Selected byfleetlint-recommended@0.1.0

Requirement

A pull_request_target workflow runs with repository secrets and must never check out or execute the PR’s code.

Why

This is the canonical workflow injection, used in real supply-chain attacks.

Applies when

repo.public && workflows().exists(w, "pull_request_target" in triggers(w))

Check

For each item in:

workflows().filter(w, "pull_request_target" in triggers(w))
!steps(item).exists(s, s.uses.startsWith("actions/checkout")
  && has(s.with.ref) && string(s.with.ref).matches("head|pull_request"))

Fix

Use pull_request for anything that builds the PR; keep pull_request_target for labelling only.

Agent instruction: Change the trigger to pull_request, or remove the checkout of the PR head from the pull_request_target workflow.

See: https://fleetlint.org/baseline/#security


Generated by fleetlint docs from catalog v0.0.0-20261011205826-ecb4e9b3ffd4.