Skip to content

Commit 1553b38

Browse files
committed
fix for various perm types
1 parent bc32c6c commit 1553b38

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

dist/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ function uniq(a) {
1313
}
1414

1515
function teamHasWrite(permission) {
16-
return permission == 'push';
16+
console.debug(`Permission provided: ${permission}`);
17+
const options = ['write', 'push', 'admin'];
18+
return options.indexOf(permission) != -1;
1719
}
1820

21+
1922
async function getTeamUsers(org, team) {
2023
const {data} = await octokit.request('GET /orgs/{org}/teams/{team_slug}/members', {
2124
org: org,

lib/helpers.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ function uniq(a) {
77
}
88

99
function teamHasWrite(permission) {
10-
return permission == 'push';
10+
console.debug(`Permission provided: ${permission}`);
11+
const options = ['write', 'push', 'admin'];
12+
return options.indexOf(permission) != -1;
1113
}
1214

15+
1316
async function getTeamUsers(org, team) {
1417
const {data} = await octokit.request('GET /orgs/{org}/teams/{team_slug}/members', {
1518
org: org,

0 commit comments

Comments
 (0)