diff --git a/lib/workers/branch/index.js b/lib/workers/branch/index.js index c0a941241b6a42f12abe50cc4d31b48bfcb61cdc..206fa5d2c778f14e007626b79ebd3720f87e4c1d 100644 --- a/lib/workers/branch/index.js +++ b/lib/workers/branch/index.js @@ -331,6 +331,11 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) { return 'error'; } else if (err.message === 'bundler-unknown') { logger.warn('Unknown bundler error'); + } else if ( + err.messagee && + err.message.includes('fatal: Authentication failed') + ) { + throw new Error('authentication-failure'); } else if ( err.message !== 'registry-failure' && err.message !== 'platform-failure' diff --git a/lib/workers/repository/error.js b/lib/workers/repository/error.js index f2c726c50b2d411d66f1c23bfbdd5817c91db09f..5acd918b8490890da47c2f56916c0a1b102c3f1a 100644 --- a/lib/workers/repository/error.js +++ b/lib/workers/repository/error.js @@ -99,6 +99,11 @@ async function handleError(config, err) { delete config.branchList; // eslint-disable-line no-param-reassign return err.message; } + if (err.message === 'authentication-error') { + logger.warn('Authentication error - aborting'); + delete config.branchList; // eslint-disable-line no-param-reassign + return err.message; + } if (err.message === 'lockfile-error') { delete config.branchList; // eslint-disable-line no-param-reassign logger.info('Lock file error - aborting'); diff --git a/test/workers/repository/error.spec.js b/test/workers/repository/error.spec.js index 3cc00d5a4719aaee1486941c8bc6838a3db51215..b37d4362d6d135ec0402f829bc624fcc89179be4 100644 --- a/test/workers/repository/error.spec.js +++ b/test/workers/repository/error.spec.js @@ -31,6 +31,7 @@ describe('workers/repository/error', () => { 'no-vulnerability-alerts', 'cannot-fork', 'integration-unauthorized', + 'authentication-error', ]; errors.forEach(err => { it(`errors ${err}`, async () => {