fix(workflow): Fix permission issue with github app and PR draft graphql endpoint #5887
@sentry/warden / warden
completed
Mar 26, 2026 in 32s
1 issue
Medium
Potentially excessive contents:write permission for draft PR conversion - `.github/workflows/enforce-draft-pr.yml:14`
The workflow adds contents: write permission alongside pull-requests: write for the pull_request_target trigger. The stated purpose is to convert a PR to draft using gh pr ready --undo, which typically only requires pull-requests: write. Granting contents: write on a pull_request_target workflow could allow unintended write access to repository contents, though this specific workflow doesn't appear to use it. If not required, this permission should be removed to follow the principle of least privilege.
4 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| code-review | 0 | 17.3s | $0.04 |
| find-bugs | 1 | 28.8s | $0.08 |
| skill-scanner | 0 | 15.1s | $0.07 |
| security-review | 0 | 17.8s | $0.09 |
Duration: 1m 19s · Tokens: 108.9k in / 2.8k out · Cost: $0.29
Loading