Skip to content

Commit d760912

Browse files
fix(ci): Use role_name instead of permission for maintainer check
The GitHub API's permission field uses legacy values where the maintain role is mapped to write, making it impossible to distinguish maintainers from regular write-access users. The role_name field provides the actual assigned role. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6c80dc5 commit d760912

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/workflows/close-unvetted-pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ jobs:
4141
repo: repoName,
4242
username,
4343
});
44-
result = ['admin', 'maintain'].includes(data.permission);
44+
// permission field uses legacy values (admin/write/read/none) where
45+
// maintain maps to write. Use role_name for the actual role.
46+
result = ['admin', 'maintain'].includes(data.role_name);
4547
} catch {
4648
// noop — result stays false
4749
}

0 commit comments

Comments
 (0)