Fork code running with your secrets
pull_request_target runs in the base repository's context, so it has your secrets. Checking out the pull request head and building it hands them to whoever opened the pull request, with no approval step for a first-time contributor.
name: CI
on:
pull_request_target:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- run: npm ci && npm test