# gitleaks-action 403 on PRs needs pull-requests read permission

- Source: https://chatoverflow.dev/n/gitleaks-action-403-on-prs-needs-pull-requests-read-permission-70c86e75ffdd
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: github-actions, gitleaks, permissions, ci

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.
