diff --git a/dist/evaluators/RepoPolicyEvaluator.js b/dist/evaluators/RepoPolicyEvaluator.js index e0dc7c4..9637e31 100644 --- a/dist/evaluators/RepoPolicyEvaluator.js +++ b/dist/evaluators/RepoPolicyEvaluator.js @@ -40,7 +40,7 @@ class RepoPolicyEvaluator { this.repositoryCheckResults.push(branch_protection_pull_request_results); } // Check the files exist policy rule - if (this.policy.file_exists.length > 0) { + if (this.policy.file_exists && this.policy.file_exists.length > 0) { const files_exist = await new FilesExistChecks_1.FilesExistChecks(this.repository, this.policy).checkFilesExist(); Logger_1.logger.debug(`Files exists results: ${JSON.stringify(files_exist)}`); this.repositoryCheckResults.push(files_exist); diff --git a/dist/index.js b/dist/index.js index 708c4c5..6aba795 100644 --- a/dist/index.js +++ b/dist/index.js @@ -47908,7 +47908,7 @@ class RepoPolicyEvaluator { this.repositoryCheckResults.push(branch_protection_pull_request_results); } // Check the files exist policy rule - if (this.policy.file_exists.length > 0) { + if (this.policy.file_exists && this.policy.file_exists.length > 0) { const files_exist = await new FilesExistChecks_1.FilesExistChecks(this.repository, this.policy).checkFilesExist(); Logger_1.logger.debug(`Files exists results: ${JSON.stringify(files_exist)}`); this.repositoryCheckResults.push(files_exist); @@ -49564,7 +49564,7 @@ const run = async () => { core.setFailed(error); } else { - Logger_1.logger.error(error); + Logger_1.logger.error(error.message); } } }; diff --git a/dist/main.js b/dist/main.js index 8140469..987fde7 100644 --- a/dist/main.js +++ b/dist/main.js @@ -90,7 +90,7 @@ const run = async () => { core.setFailed(error); } else { - Logger_1.logger.error(error); + Logger_1.logger.error(error.message); } } }; diff --git a/src/github/Repositories.ts b/src/github/Repositories.ts index af7194b..8c8a6f4 100644 --- a/src/github/Repositories.ts +++ b/src/github/Repositories.ts @@ -28,14 +28,15 @@ export const getRepository = async ( repo: string, ): Promise => { const octokit = new GitArmorKit(); - + const response: Endpoints["GET /repos/{owner}/{repo}"]["response"] = await octokit.rest.repos.get({ owner: owner, repo: repo, }); - + return response.data; + }; export const getRepoPullRequests = async ( diff --git a/src/main.ts b/src/main.ts index a5e0177..270b4de 100644 --- a/src/main.ts +++ b/src/main.ts @@ -64,7 +64,7 @@ const run = async (): Promise => { repository, policies.repo as RepoPolicy, ); - + await policyEvaluator.evaluatePolicy(); policyEvaluator.printCheckResults(); report.addOneRepoEvaluator(policyEvaluator); @@ -86,7 +86,7 @@ const run = async (): Promise => { if (process.env.GITHUB_ACTIONS) { core.setFailed(error); } else { - logger.error(error); + logger.error(error.message); } } };