diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index 71f244144e792c801af13f0960b924aa7cf24aba..67a7bd4b3ae39c909c43c89666bcdf9e1c5ae2b9 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -115,15 +115,21 @@ async function getRepoForceRebase() { try { config.repoForceRebase = false; const branchProtection = await getBranchProtection(config.baseBranch); - logger.info('Base branch protection found'); + logger.info('Branch protection found'); if (branchProtection.required_pull_request_reviews) { - logger.info('PR Reviews are required before merging'); + logger.info( + 'Branch protection: PR Reviews are required before merging' + ); config.prReviewsRequired = true; } if (branchProtection.required_status_checks) { - logger.info('Status checks are required before merging'); + logger.info( + 'Branch protection: Status checks are required before merging' + ); if (branchProtection.required_status_checks.strict) { - logger.info('PRs must be up-to-date before merging'); + logger.info( + 'Branch protection: PRs must be up-to-date before merging' + ); config.repoForceRebase = true; } } @@ -133,17 +139,17 @@ async function getRepoForceRebase() { users: branchProtection.restrictions.users, teams: branchProtection.restrictions.teams, }, - 'Pushing to branch is restricted' + 'Branch protection: Pushing to branch is restricted' ); config.pushProtection = true; } } catch (err) { if (err.statusCode === 404) { - logger.info( - `Repository has no branch protection for ${config.baseBranch}` - ); + logger.info(`Branch protection: none found`); } else if (err.statusCode === 403) { - logger.debug('Do not have permissions to detect branch protection'); + logger.warn( + 'Branch protection: Do not have permissions to detect branch protection' + ); } else { throw err; }