Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jamoor-moj committed Apr 15, 2024
1 parent 4771f80 commit 3b01b1d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions dist/index.js

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

12 changes: 6 additions & 6 deletions src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ async function filter_only_collaborators(reviewers) {
const [ teams_with_prefix, individuals ] = partition(reviewers, (reviewer) => reviewer.startsWith('team:'));
const teams = teams_with_prefix.map((team_with_prefix) => team_with_prefix.replace('team:', ''));

// Create a list of requests for all available aliases to see if they have permission to the
// PR associated with this action
// Create a list of requests for all available aliases and teams to see if they have permission
// to the PR associated with this action
const collaborator_responses = [];
teams.forEach((team) => {
collaborator_responses.push(octokit.teams.checkPermissionsForRepoInOrg({
Expand All @@ -180,8 +180,8 @@ async function filter_only_collaborators(reviewers) {
owner: context.repo.owner,
repo: context.repo.repo,
}).then((response) => {
// https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#check-if-a-user-is-a-repository-collaborator
// Its expected that a collaborator with permission will return 204
// https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository
// Its expected that a team with permission will return 204
core.info(`Received successful status code ${response?.status ?? 'Unknown'} for team: ${team}`);
return 'team:'.concat(team);
}).catch((error) => core.error(`Team: ${team} failed to be added with error: ${error}`)));
Expand All @@ -192,8 +192,8 @@ async function filter_only_collaborators(reviewers) {
repo: context.repo.repo,
username: alias,
}).then((response) => {
// https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#check-team-permissions-for-a-repository
// Its expected that a team with permission will return 204
// https://docs.github.com/en/rest/collaborators/collaborators?apiVersion=2022-11-28#check-if-a-user-is-a-repository-collaborator
// Its expected that a collaborator with permission will return 204
core.info(`Received successful status code ${response?.status ?? 'Unknown'} for alias: ${alias}`);
return alias;
}).catch((error) => core.error(`Individual: ${alias} failed to be added with error: ${error}`)));
Expand Down

0 comments on commit 3b01b1d

Please sign in to comment.