@@ -20,6 +20,7 @@ import {actions} from './actions/index.js';
2020import { verifyNgDevToolIsUpToDate } from '../../utils/version-check.js' ;
2121import { Log , yellow } from '../../utils/logging.js' ;
2222import { Prompt } from '../../utils/prompt.js' ;
23+ import { getRepoConfigValue } from '../../caretaker/config/get/index.js' ;
2324
2425export enum CompletionState {
2526 SUCCESS ,
@@ -50,6 +51,7 @@ export class ReleaseTool {
5051 const nextBranchName = getNextBranchName ( this . _github ) ;
5152
5253 if (
54+ ! ( await this . _verifyInReleaseMergeMode ( ) ) ||
5355 ! ( await this . _verifyNoUncommittedChanges ( ) ) ||
5456 ! ( await this . _verifyRunningFromNextBranch ( nextBranchName ) ) ||
5557 ! ( await this . _verifyNoShallowRepository ( ) ) ||
@@ -144,6 +146,24 @@ export class ReleaseTool {
144146 return true ;
145147 }
146148
149+ /**
150+ * Verifies that there are no uncommitted changes in the project.
151+ * @returns a boolean indicating success or failure.
152+ */
153+ private async _verifyInReleaseMergeMode ( ) : Promise < boolean > {
154+ const currentMergeMode = await getRepoConfigValue ( 'merge-mode' ) ;
155+ if ( currentMergeMode !== 'release' ) {
156+ Log . error (
157+ ` ✘ The repository merge-mode is currently set to ${ currentMergeMode } but must be set to release before` ,
158+ ) ;
159+ Log . error (
160+ '. publishing releases. You can set the repository to relese by running `ng-dev caretaker start-release`' ,
161+ ) ;
162+ return false ;
163+ }
164+ return true ;
165+ }
166+
147167 /**
148168 * Verifies that the local repository is not configured as shallow.
149169 * @returns a boolean indicating success or failure.
0 commit comments