diff --git a/dist/evaluators/RepoPolicyEvaluator.js b/dist/evaluators/RepoPolicyEvaluator.js index 9637e31..8911b21 100644 --- a/dist/evaluators/RepoPolicyEvaluator.js +++ b/dist/evaluators/RepoPolicyEvaluator.js @@ -29,7 +29,7 @@ class RepoPolicyEvaluator { this.repositoryData = await (0, Repositories_1.getRepository)(this.repository.owner, this.repository.name); Logger_1.logger.debug("Repository policy for repo: " + this.repository.name); // Check the branch protection policy rule - if (this.policy.protected_branches.length > 0) { + if (this.policy.protected_branches && this.policy.protected_branches.length > 0) { const branch_protection = new BranchProtectionChecks_1.BranchProtectionChecks(this.policy, this.repository); const branch_protection_results = await branch_protection.checkBranchProtection(); Logger_1.logger.debug(`Branch protection rule results: ${JSON.stringify(branch_protection_results, null, 2)}`); diff --git a/dist/index.js b/dist/index.js index 2ceef20..1620159 100644 --- a/dist/index.js +++ b/dist/index.js @@ -47897,7 +47897,7 @@ class RepoPolicyEvaluator { this.repositoryData = await (0, Repositories_1.getRepository)(this.repository.owner, this.repository.name); Logger_1.logger.debug("Repository policy for repo: " + this.repository.name); // Check the branch protection policy rule - if (this.policy.protected_branches.length > 0) { + if (this.policy.protected_branches && this.policy.protected_branches.length > 0) { const branch_protection = new BranchProtectionChecks_1.BranchProtectionChecks(this.policy, this.repository); const branch_protection_results = await branch_protection.checkBranchProtection(); Logger_1.logger.debug(`Branch protection rule results: ${JSON.stringify(branch_protection_results, null, 2)}`); diff --git a/src/evaluators/RepoPolicyEvaluator.ts b/src/evaluators/RepoPolicyEvaluator.ts index b2c1071..f8e6627 100644 --- a/src/evaluators/RepoPolicyEvaluator.ts +++ b/src/evaluators/RepoPolicyEvaluator.ts @@ -34,7 +34,7 @@ export class RepoPolicyEvaluator { logger.debug("Repository policy for repo: " + this.repository.name); // Check the branch protection policy rule - if (this.policy.protected_branches.length > 0) { + if (this.policy.protected_branches && this.policy.protected_branches.length > 0) { const branch_protection = new BranchProtectionChecks( this.policy, this.repository,