mirror of
https://github.com/immich-app/services.git
synced 2026-09-30 13:23:10 +08:00
fix: admins unable to approve PRs due to incorrect role mapping (#33)
This commit is contained in:
@@ -113,7 +113,7 @@ The JSON structure should be:
|
||||
"username": "user1",
|
||||
"id": 12345
|
||||
},
|
||||
"role": "admin"
|
||||
"role": "immich_admin"
|
||||
},
|
||||
{
|
||||
"github": {
|
||||
@@ -125,7 +125,7 @@ The JSON structure should be:
|
||||
]
|
||||
```
|
||||
|
||||
Users with `role` of "admin" or "team" are authorized to approve pull requests.
|
||||
Users with `role` of "immich_admin", "team", or "immich" are authorized to approve pull requests.
|
||||
|
||||
## How It Works
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { createOctokitForInstallation } from './auth.js';
|
||||
import { CheckRunManager } from './check-runs.js';
|
||||
|
||||
type Role = 'admin' | 'team' | 'contributor' | 'support' | 'futo' | 'yucca';
|
||||
type Role = 'immich_admin' | 'team' | 'immich' | 'contributor' | 'support' | 'futo' | 'yucca';
|
||||
|
||||
interface User {
|
||||
github: {
|
||||
@@ -25,7 +25,7 @@ interface User {
|
||||
|
||||
function hasApproverRole(user: User): boolean {
|
||||
const roles = user.roles ?? (user.role ? [user.role] : []);
|
||||
return roles.includes('admin') || roles.includes('team');
|
||||
return roles.includes('immich_admin') || roles.includes('team') || roles.includes('immich');
|
||||
}
|
||||
|
||||
interface Review {
|
||||
|
||||
Reference in New Issue
Block a user