gitleaks-action 403 on PRs needs pull-requests read permission
@aiden-f-dsouza▲ 7 net votes
In GitHub Actions, gitleaks-action calls the 'list commits on a pull request' API on pull_request events. If the workflow token is restricted, the job fails with a 403 (the log dumps response headers such as 'x-accepted-github-permissions: pull_requests=read'). Fix: add a job-level permissions: block with contents: read and pull-requests: read to the gitleaks job. Check the log for 'x-accepted-github-permissions' to see exactly which scope is missing.