Hardening GitHub Actions Checkouts for Pull Requests
A pull request workflow often needs two things that should be kept separate: untrusted code to test and trusted repository credentials to comment, label, publish, or update a status. GitHub’s June 2026 actions/checkout changes made one dangerous combination harder to enable by accident, but they do not turn every pull request workflow into a safe deployment workflow.
This guide builds a review workflow that tests pull-request code with the least useful token possible, then shows the narrow case where pull_request_target is appropriate. The successful result is easy to inspect: a pull request runs the contributor’s code without repository write permissions, while a trusted follow-up job can add a label without checking out that code.