Skip to content

Commit 1c798a8

Browse files
committed
feat: ✅ inform when release is interrupted if no changes
1 parent edeb262 commit 1c798a8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/semver/src/builders/version/builder.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ describe('@jscutlery/semver:version', () => {
5656
callbackify(jest.fn().mockResolvedValue('')) as any
5757
);
5858

59+
/* Mock console.info. */
60+
jest.spyOn(console, 'info').mockImplementation();
61+
5962
/* Mock getPackageFiles. */
6063
jest
6164
.spyOn(workspace, 'getPackageFiles')
@@ -70,6 +73,7 @@ describe('@jscutlery/semver:version', () => {
7073
});
7174

7275
afterEach(() => {
76+
(console.info as jest.Mock).mockRestore();
7377
(getPackageFiles as jest.Mock).mockRestore();
7478
(getProjectRoots as jest.Mock).mockRestore();
7579
mockChangelog.mockRestore();
@@ -164,6 +168,9 @@ describe('@jscutlery/semver:version', () => {
164168

165169
expect(success).toBe(true);
166170

171+
expect(console.info).toBeCalledWith(
172+
'⏹ nothing changed since last release'
173+
);
167174
expect(standardVersion).not.toBeCalled();
168175
});
169176
});
@@ -262,6 +269,9 @@ describe('@jscutlery/semver:version', () => {
262269

263270
expect(success).toBe(true);
264271

272+
expect(console.info).toBeCalledWith(
273+
'⏹ nothing changed since last release'
274+
);
265275
expect(standardVersion).not.toBeCalled();
266276
});
267277
});

packages/semver/src/builders/version/builder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export function runBuilder(
4242
const action$ = forkJoin([projectRoot$, newVersion$]).pipe(
4343
switchMap(([projectRoot, newVersion]) => {
4444
if (newVersion == null) {
45+
console.info('⏹ nothing changed since last release');
4546
return of(undefined);
4647
}
4748

0 commit comments

Comments
 (0)