mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-31 09:41:46 +00:00
da50c75c49
* refactor: move onboardingPrTitle to InheritConfig * remove unwanted flat clone
51 lines
1.7 KiB
TypeScript
51 lines
1.7 KiB
TypeScript
import type { AllConfig, RenovateConfig } from '../../../config/types.ts';
|
|
import { logger } from '../../../logger/index.ts';
|
|
import { platform } from '../../../modules/platform/index.ts';
|
|
import * as repositoryCache from '../../../util/cache/repository/index.ts';
|
|
import { getInheritedOrGlobal } from '../../../util/common.ts';
|
|
import { clearRenovateRefs } from '../../../util/git/index.ts';
|
|
import { PackageFiles } from '../package-files.ts';
|
|
import { checkReconfigureBranch } from '../reconfigure/index.ts';
|
|
import { pruneStaleBranches } from './prune.ts';
|
|
import {
|
|
runBranchSummary,
|
|
runRenovateRepoStats,
|
|
} from './repository-statistics.ts';
|
|
|
|
// istanbul ignore next
|
|
export async function finalizeRepo(
|
|
config: RenovateConfig,
|
|
branchList: string[],
|
|
repoConfig: AllConfig,
|
|
): Promise<void> {
|
|
await checkReconfigureBranch(config, repoConfig);
|
|
await pruneStaleBranches(config, branchList);
|
|
await repositoryCache.saveCache();
|
|
await ensureIssuesClosing();
|
|
await clearRenovateRefs();
|
|
PackageFiles.clear();
|
|
const prList = await platform.getPrList();
|
|
if (
|
|
prList?.some(
|
|
(pr) =>
|
|
pr.state === 'merged' &&
|
|
pr.title !== 'Configure Renovate' &&
|
|
pr.title !== getInheritedOrGlobal('onboardingPrTitle') &&
|
|
pr.sourceBranch !== getInheritedOrGlobal('onboardingBranch'),
|
|
)
|
|
) {
|
|
logger.debug('Repo is activated');
|
|
config.repoIsActivated = true;
|
|
}
|
|
runBranchSummary(config);
|
|
runRenovateRepoStats(config, prList);
|
|
}
|
|
|
|
// istanbul ignore next
|
|
function ensureIssuesClosing(): Promise<Awaited<void>[]> {
|
|
return Promise.all([
|
|
platform.ensureIssueClosing(`Action Required: Fix Renovate Configuration`),
|
|
platform.ensureIssueClosing(`Action Required: Add missing credentials`),
|
|
]);
|
|
}
|