Skip to content

Commit

Permalink
Merge pull request #39 from Omegapoint/feature/FixedBranchprotectionZero
Browse files Browse the repository at this point in the history
refactor project
  • Loading branch information
jonathanbokvad authored Oct 3, 2023
2 parents 6a376f9 + 2540cd9 commit 998feda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/branchprotection/BranchProtectionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export class BranchProtectionService {
}

let numberOfReviewers: number = 0;

if (
response.data.enforce_admins?.enabled === true &&
response.data.required_pull_request_reviews?.required_approving_review_count
Expand All @@ -34,9 +33,11 @@ export class BranchProtectionService {

core.exportVariable('numberOfReviewers', numberOfReviewers);
} catch (error) {
console.log('error', error);
core.warning('Error getting branch protection!');
console.log('Error:', error.message);
if (error.status === 403) {
core.exportVariable('numberOfReviewers', 0);
}
}
}
}

0 comments on commit 998feda

Please sign in to comment.