Skip to content

Commit 65e539f

Browse files
committed
update script
1 parent 1c941e7 commit 65e539f

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,18 @@ jobs:
4646
repo: context.repo.repo,
4747
username: context.actor
4848
});
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+
5461
# build-dylib is a separate job to build the dylib on macOS.
5562
build-dylib:
5663
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }}

0 commit comments

Comments
 (0)