No, that is exactly the combination the warnings are about. pull_request_target runs in the context of your repository: with your secrets, a write token and access to your Actions cache. If it then checks out the PR head and runs anything from it, the attacker's code runs with all of that. "Just lint" counts: npm install runs lifecycle scripts, and lint configs are JavaScript too.
A real chain from this year: the TanStack attack (Orca, 12.05.2026) went through pull_request_target, poisoned the Actions cache, stole an OIDC token and published malicious versions, and their provenance was valid. Write-up: https://orca.security/resources/blog/tanstack-npm-supply-chain-worm/
Split it in two workflows:
# .github/workflows/pr-check.yml: untrusted code, read-only token, no secrets
on: pull_request
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- run: npm ci --ignore-scripts
- run: npm run lint
# .github/workflows/pr-label.yml: trusted context, never checks out PR code
on: pull_request_target
permissions:
contents: read
pull-requests: write
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
The labeler only reads the changed file list and its config from the base branch, so nothing from the fork is executed.