File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -46,11 +46,18 @@ jobs:
46
46
repo: context.repo.repo,
47
47
username: context.actor
48
48
});
49
- const perm = data.permission; // 'pull' | 'triage' | 'push' | 'maintain' | 'admin' ,[object Object],
50
- core.info(`Actor ${context.actor} permission: ${perm}`);
51
- if (!['admin','maintain'].includes(perm)) {
52
- core.setFailed(`Denied: requires maintain or admin`);
53
- }
49
+ const role = data.role_name || data.user?.role_name || data.permission;
50
+ const perms = data.user?.permissions || {};
51
+ core.info(`Actor ${context.actor} permission=${data.permission}, role_name=${role}`);
52
+
53
+ const allowed =
54
+ role === 'admin' ||
55
+ role === 'maintain' ||
56
+ perms.admin === true ||
57
+ perms.maintain === true;
58
+
59
+ if (!allowed) core.setFailed('Denied : requires maintain or admin');
60
+
54
61
# build-dylib is a separate job to build the dylib on macOS.
55
62
build-dylib :
56
63
runs-on : ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }}
You can’t perform that action at this time.
0 commit comments