renovate 40.26.3 → 40.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/platform/default-scm.d.ts +1 -0
- package/dist/modules/platform/default-scm.js +6 -0
- package/dist/modules/platform/default-scm.js.map +1 -1
- package/dist/modules/platform/github/index.js +6 -21
- package/dist/modules/platform/github/index.js.map +1 -1
- package/dist/modules/platform/types.d.ts +1 -0
- package/dist/modules/platform/types.js.map +1 -1
- package/dist/util/git/index.d.ts +19 -0
- package/dist/util/git/index.js +114 -3
- package/dist/util/git/index.js.map +1 -1
- package/dist/util/git/types.d.ts +1 -0
- package/dist/util/git/types.js.map +1 -1
- package/dist/workers/repository/process/index.js +3 -0
- package/dist/workers/repository/process/index.js.map +1 -1
- package/package.json +1 -1
@@ -12,4 +12,5 @@ export declare class DefaultGitScm implements PlatformScm {
|
|
12
12
|
checkoutBranch(branchName: string): Promise<LongCommitSha>;
|
13
13
|
mergeAndPush(branchName: string): Promise<void>;
|
14
14
|
mergeToLocal(branchName: string): Promise<void>;
|
15
|
+
syncForkWithUpstream(branchName: string): Promise<void>;
|
15
16
|
}
|
@@ -37,6 +37,12 @@ class DefaultGitScm {
|
|
37
37
|
mergeToLocal(branchName) {
|
38
38
|
return git.mergeToLocal(branchName);
|
39
39
|
}
|
40
|
+
async syncForkWithUpstream(branchName) {
|
41
|
+
const remotes = await git.getRemotes();
|
42
|
+
if (remotes?.includes('upstream')) {
|
43
|
+
await git.syncForkWithUpstream(branchName);
|
44
|
+
}
|
45
|
+
}
|
40
46
|
}
|
41
47
|
exports.DefaultGitScm = DefaultGitScm;
|
42
48
|
//# sourceMappingURL=default-scm.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"default-scm.js","sourceRoot":"","sources":["../../../lib/modules/platform/default-scm.ts"],"names":[],"mappings":";;;;AAAA,4DAAsC;AAItC,MAAa,aAAa;IACxB,YAAY,CAAC,UAAkB;QAC7B,OA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,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;YAClC,MAAM,GAAG,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;CACF;AArDD,sCAqDC","sourcesContent":["import * as git from '../../util/git';\nimport type { CommitFilesConfig, LongCommitSha } from '../../util/git/types';\nimport type { PlatformScm } from './types';\n\nexport class DefaultGitScm implements PlatformScm {\n branchExists(branchName: string): Promise<boolean> {\n return Promise.resolve(git.branchExists(branchName));\n }\n\n commitAndPush(\n commitConfig: CommitFilesConfig,\n ): Promise<LongCommitSha | null> {\n return git.commitFiles(commitConfig);\n }\n\n deleteBranch(branchName: string): Promise<void> {\n return git.deleteBranch(branchName);\n }\n\n getBranchCommit(branchName: string): Promise<LongCommitSha | null> {\n return Promise.resolve(git.getBranchCommit(branchName));\n }\n\n isBranchBehindBase(branchName: string, baseBranch: string): Promise<boolean> {\n return git.isBranchBehindBase(branchName, baseBranch);\n }\n\n isBranchConflicted(baseBranch: string, branch: string): Promise<boolean> {\n return git.isBranchConflicted(baseBranch, branch);\n }\n\n isBranchModified(branchName: string, baseBranch: string): Promise<boolean> {\n return git.isBranchModified(branchName, baseBranch);\n }\n\n getFileList(): Promise<string[]> {\n return git.getFileList();\n }\n\n checkoutBranch(branchName: string): Promise<LongCommitSha> {\n return git.checkoutBranch(branchName);\n }\n\n mergeAndPush(branchName: string): Promise<void> {\n return git.mergeBranch(branchName);\n }\n\n mergeToLocal(branchName: string): Promise<void> {\n return git.mergeToLocal(branchName);\n }\n\n async syncForkWithUpstream(branchName: string): Promise<void> {\n const remotes = await git.getRemotes();\n if (remotes?.includes('upstream')) {\n await git.syncForkWithUpstream(branchName);\n }\n }\n}\n"]}
|
@@ -525,27 +525,6 @@ async function initRepo({ endpoint, repository, forkCreation, forkOrg, forkToken
|
|
525
525
|
logger_1.logger.warn({ err }, 'Could not set default branch');
|
526
526
|
} /* v8 ignore stop */
|
527
527
|
}
|
528
|
-
// This is a lovely "hack" by GitHub that lets us force update our fork's default branch
|
529
|
-
// with the base commit from the parent repository
|
530
|
-
const url = `repos/${config.repository}/git/refs/heads/${config.defaultBranch}`;
|
531
|
-
const sha = repo.defaultBranchRef.target.oid;
|
532
|
-
try {
|
533
|
-
logger_1.logger.debug(`Updating forked repository default sha ${sha} to match upstream`);
|
534
|
-
await common_2.githubApi.patchJson(url, {
|
535
|
-
body: {
|
536
|
-
sha,
|
537
|
-
force: true,
|
538
|
-
},
|
539
|
-
token: (0, string_1.coerceString)(forkToken, opts.token),
|
540
|
-
});
|
541
|
-
}
|
542
|
-
catch (err) /* v8 ignore start */ {
|
543
|
-
logger_1.logger.warn({ url, sha, err: err.err ?? err }, 'Error updating fork from upstream - cannot continue');
|
544
|
-
if (err instanceof external_host_error_1.ExternalHostError) {
|
545
|
-
throw err;
|
546
|
-
}
|
547
|
-
throw new external_host_error_1.ExternalHostError(err);
|
548
|
-
} /* v8 ignore stop */
|
549
528
|
}
|
550
529
|
else if (forkCreation) {
|
551
530
|
logger_1.logger.debug('Forked repo is not found - attempting to create it');
|
@@ -573,9 +552,15 @@ async function initRepo({ endpoint, repository, forkCreation, forkOrg, forkToken
|
|
573
552
|
parsedEndpoint.host = parsedEndpoint.host.replace('api.github.com', 'github.com');
|
574
553
|
parsedEndpoint.pathname = `${config.repository}.git`;
|
575
554
|
const url = node_url_1.default.format(parsedEndpoint);
|
555
|
+
let upstreamUrl = undefined;
|
556
|
+
if (forkCreation && config.parentRepo) {
|
557
|
+
parsedEndpoint.pathname = config.parentRepo + '.git';
|
558
|
+
upstreamUrl = node_url_1.default.format(parsedEndpoint);
|
559
|
+
}
|
576
560
|
await git.initRepo({
|
577
561
|
...config,
|
578
562
|
url,
|
563
|
+
upstreamUrl,
|
579
564
|
});
|
580
565
|
const repoConfig = {
|
581
566
|
defaultBranch: config.defaultBranch,
|