resolve release promotion unrelated-history conflicts by taking source side
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2026-07-07 18:11:42 +09:00
parent 6006bcb85e
commit de98022e2c
+10
View File
@@ -702,6 +702,7 @@ export class AppsService {
targetBranch,
`origin/${targetBranch}`,
], { cwd: workDir });
await this.resetPromotionWorktree(gitBin, workDir);
try {
await execFileAsync(gitBin, [
...mergeOptions,
@@ -715,6 +716,7 @@ export class AppsService {
throw error;
}
try {
await this.resetPromotionWorktree(gitBin, workDir);
await execFileAsync(gitBin, [
...mergeOptions,
'merge',
@@ -757,6 +759,7 @@ export class AppsService {
commitSha: string,
repository: string,
) {
await this.resetPromotionWorktree(gitBin, workDir);
await execFileAsync(gitBin, [
...mergeOptions,
'merge',
@@ -771,6 +774,13 @@ export class AppsService {
await execFileAsync(gitBin, ['commit', '--allow-empty', '-m', `${repository} release promotion merge`], { cwd: workDir });
}
private async resetPromotionWorktree(gitBin: string, workDir: string) {
await execFileAsync(gitBin, ['merge', '--abort'], { cwd: workDir }).catch(() => undefined);
await execFileAsync(gitBin, ['rebase', '--abort'], { cwd: workDir }).catch(() => undefined);
await execFileAsync(gitBin, ['reset', '--hard'], { cwd: workDir }).catch(() => undefined);
await execFileAsync(gitBin, ['clean', '-fd'], { cwd: workDir }).catch(() => undefined);
}
private getHttpCloneUrl(repository: string) {
return `${this.configService
.get<string>('GITEA_BASE_URL', 'http://localhost:3000')