diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts index ded0460d315cb17285fb02ae927afe1dbd373ccd..f80169ccd8f6bbc8a346bfc56ee7543766c8374e 100644 --- a/lib/platform/github/index.ts +++ b/lib/platform/github/index.ts @@ -465,7 +465,10 @@ export async function getRepoForceRebase(): Promise<boolean> { } catch (err) { if (err.statusCode === 404) { logger.debug(`No branch protection found`); - } else if (err.statusCode === 403) { + } else if ( + err.message === PLATFORM_INTEGRATION_UNAUTHORIZED || + err.statusCode === 403 + ) { logger.debug( 'Branch protection: Do not have permissions to detect branch protection' );