Skip to content

Commit

Permalink
refactor project
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanbokvad committed Oct 2, 2023
1 parent 066f0ec commit dfca0a5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/branchprotection/BranchProtectionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ export class BranchProtectionService {
repo,
branch: 'main',
});
const numberOfReviewers: number =
response.data.required_pull_request_reviews?.required_approving_review_count || 0;
console.log('Response', response.data);

if (response.data.enforce_admins?.enabled === false) {
console.log('Branch protection can be overridden by admins and is therefore counted as not enabled');
}

const numberOfReviewers: number =
response.data.required_pull_request_reviews?.required_approving_review_count || 0;

if (numberOfReviewers >= 1 && response.data.enforce_admins?.enabled === true) {
console.log('Branch protection is enabled, number of reviewers:', numberOfReviewers);
} else {
Expand Down

0 comments on commit dfca0a5

Please sign in to comment.