Skip to content

Commit

Permalink
fix(local): don't validate reconfigure branch (#31009)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamietanna committed Aug 25, 2024
1 parent 80bc9d0 commit 00a20a8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/workers/repository/reconfigure/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ describe('workers/repository/reconfigure/index', () => {
GlobalConfig.reset();
});

it('no effect when running with platform=local', async () => {
GlobalConfig.set({ platform: 'local' });
await validateReconfigureBranch(config);
expect(logger.debug).toHaveBeenCalledWith(
'Not attempting to reconfigure when running with local platform',
);
});

it('no effect on repo with no reconfigure branch', async () => {
scm.branchExists.mockResolvedValueOnce(false);
await validateReconfigureBranch(config);
Expand Down
8 changes: 8 additions & 0 deletions lib/workers/repository/reconfigure/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import is from '@sindresorhus/is';
import JSON5 from 'json5';
import { GlobalConfig } from '../../../config/global';
import type { RenovateConfig } from '../../../config/types';
import { validateConfig } from '../../../config/validation';
import { logger } from '../../../logger';
Expand Down Expand Up @@ -43,6 +44,13 @@ export async function validateReconfigureBranch(
config: RenovateConfig,
): Promise<void> {
logger.debug('validateReconfigureBranch()');
if (GlobalConfig.get('platform') === 'local') {
logger.debug(
'Not attempting to reconfigure when running with local platform',
);
return;
}

const context = config.statusCheckNames?.configValidation;

const branchName = getReconfigureBranchName(config.branchPrefix!);
Expand Down

0 comments on commit 00a20a8

Please sign in to comment.