From 41eab272006a4e0613d0bf94e76954aa8196690b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 23 Jun 2026 18:54:26 +0200 Subject: [PATCH] chore(git-node): remove abort error in case of fixable error --- lib/promote_release.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/promote_release.js b/lib/promote_release.js index 14585586..a3b39e63 100644 --- a/lib/promote_release.js +++ b/lib/promote_release.js @@ -523,11 +523,7 @@ export default class ReleasePromotion extends Session { cli.separator(); cli.info('Resolve the conflicts and commit the result'); cli.separator(); - const didResolveConflicts = await cli.prompt( - 'Finished resolving cherry-pick conflicts?', { defaultAnswer: true }); - if (!didResolveConflicts) { - throw new Error('Aborted'); - } + await cli.prompt('Ready to continue?', { defaultAnswer: true }); } if (existsSync('.git/CHERRY_PICK_HEAD')) { @@ -537,16 +533,20 @@ export default class ReleasePromotion extends Session { } // Validate release commit on the default branch - const releaseCommitOnDefaultBranch = - await forceRunAsync('git', ['show', 'HEAD', '--name-only', '--pretty=format:%s'], - { captureStdout: true, ignoreFailure: false }); - const [commitTitle, ...modifiedFiles] = releaseCommitOnDefaultBranch.trim().split('\n'); - await this.validateReleaseCommit(commitTitle); - if (modifiedFiles.some(file => !file.endsWith('.md'))) { - cli.warn('Some modified files are not markdown, that\'s unusual.'); - cli.info(`The list of modified files: ${modifiedFiles.map(f => `- ${f}`).join('\n')}`); - if (!await cli.prompt('Do you want to proceed anyway?', { defaultAnswer: false })) { - throw new Error('Aborted'); + while (true) { + const releaseCommitOnDefaultBranch = + await forceRunAsync('git', ['show', 'HEAD', '--name-only', '--pretty=format:%s'], + { captureStdout: true, ignoreFailure: false }); + const [commitTitle, ...modifiedFiles] = releaseCommitOnDefaultBranch.trim().split('\n'); + await this.validateReleaseCommit(commitTitle); + if (modifiedFiles.some(file => !file.endsWith('.md'))) { + cli.warn('Some modified files are not markdown, that\'s unusual.'); + cli.info(`The list of modified files: ${modifiedFiles.map(f => `- ${f}`).join('\n')}`); + if (await cli.prompt('Consider amending the commit before continuing. Ready to continue?', { + defaultAnswer: false + })) { + break; + } } } }