Skip to content

Commit

Permalink
fix: remove static team
Browse files Browse the repository at this point in the history
  • Loading branch information
olivercodes committed Aug 11, 2022
1 parent 9497798 commit 2ea7c2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ function teamHasWrite(permission) {
return permission == 'push';
}

async function getTeamUsers(team) {
async function getTeamUsers(org, team) {
const {data} = await octokit.request('GET /orgs/{org}/teams/{team_slug}/members', {
org: 'ThoughtWorks-DPS',
org: org,
team_slug: team
});

Expand All @@ -41,7 +41,7 @@ async function getRepoTeams(org, repo) {
async function getUserIsApprover(org, repo, user) {
const repoTeams = await getRepoTeams(org, repo);
teamsArrays = await Promise.all(
repoTeams.map(team => getTeamUsers(team))
repoTeams.map(team => getTeamUsers(org, team))
).catch((err) => {
console.error(err)
core.setFailed(err);
Expand Down
6 changes: 3 additions & 3 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ function teamHasWrite(permission) {
return permission == 'push';
}

async function getTeamUsers(team) {
async function getTeamUsers(org, team) {
const {data} = await octokit.request('GET /orgs/{org}/teams/{team_slug}/members', {
org: 'ThoughtWorks-DPS',
org: org,
team_slug: team
});

Expand All @@ -35,7 +35,7 @@ async function getRepoTeams(org, repo) {
async function getUserIsApprover(org, repo, user) {
const repoTeams = await getRepoTeams(org, repo);
teamsArrays = await Promise.all(
repoTeams.map(team => getTeamUsers(team))
repoTeams.map(team => getTeamUsers(org, team))
).catch((err) => {
console.error(err)
core.setFailed(err);
Expand Down

0 comments on commit 2ea7c2c

Please sign in to comment.