Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vsingal-p committed Apr 2, 2024
1 parent 36af523 commit a6ae38a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
12 changes: 6 additions & 6 deletions dist/431.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/431.index.js.map

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions dist/676.index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/676.index.js.map

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions src/helpers/approvals-satisfied.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const approvalsSatisfied = async ({ teams, users, number_of_reviewers = '

const teamsList = updateTeamsList(teams?.split('\n'));
if (!validateTeamsList(teamsList)) {
core.setFailed('Teams input must be in the format "org/team" or "team". The org must be the same as the repository owner.');
core.setFailed('If teams input is in the format "org/team", then the org must be the same as the repository org');
return false;
}
const usersList = users?.split('\n');
Expand Down Expand Up @@ -102,12 +102,11 @@ const updateTeamsList = (teamsList?: string[]) => {

const validateTeamsList = (teamsList?: string[]) => {
if (teamsList) {
teamsList.forEach(team => {
return teamsList.every(team => {
const inputOrg = team.split('/')[0];
if (inputOrg !== context.repo.owner) {
return false;
}
return inputOrg === context.repo.owner;
});
} else {
return true;
}
return true;
};

0 comments on commit a6ae38a

Please sign in to comment.