ci: Add workflow to close unvetted non-maintainer PRs #5895
3 issues
Medium
Maintainer check uses PR repository instead of referenced issue's repository - `.github/workflows/close-unvetted-pr.yml:199`
On line 199, isMaintainer(repo.owner, repo.repo, user) checks if the user is a maintainer of the PR's target repository, not the issue's repository (ref.owner, ref.repo). The comment on lines 188-189 states 'Check each commenter (and issue author) for admin/maintain access on the issue's repo', but the implementation checks the PR's repo instead. For cross-repo issue references (e.g., getsentry/other-repo#123), this may incorrectly validate or reject PRs based on maintainer status in the wrong repository.
Maintainer check uses PR repository instead of issue repository for cross-repo references - `.github/workflows/close-unvetted-pr.yml:199`
On line 199, the isMaintainer(repo.owner, repo.repo, user) call checks maintainer status against the PR's target repository, but the comment on line 188 states the intent is to check "admin/maintain access on the issue's repo". For cross-repository issue references (e.g., getsentry/other-repo#123), this causes the wrong repository to be checked. A maintainer of the referenced issue's repository who hasn't write access to the PR's repository would fail the check, resulting in valid PRs being incorrectly closed.
Low
Potential null access if PR author user is deleted - `.github/workflows/close-unvetted-pr.yml:29`
Line 29 accesses pullRequest.user.login without null-checking. If the PR author's GitHub account is deleted or suspended between PR creation and workflow execution, pullRequest.user could be null, causing a runtime error. The code already handles this pattern for issue users (line 183-184) but not for the PR author.
4 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| code-review | 2 | 57.1s | $0.21 |
| find-bugs | 1 | 58.0s | $0.24 |
| skill-scanner | 0 | 31.5s | $0.19 |
| security-review | 0 | 1m 29s | $0.48 |
Duration: 3m 56s · Tokens: 459.9k in / 8.9k out · Cost: $1.15 (+extraction: $0.00, +merge: $0.00, +fix_gate: $0.01, +dedup: $0.01)