Skip to content

Commit

Permalink
fix(core): always run afterShipIt hook
Browse files Browse the repository at this point in the history
  • Loading branch information
jBouyoud committed Mar 24, 2022
1 parent 43dad64 commit c37efe4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
7 changes: 6 additions & 1 deletion packages/core/src/__tests__/auto.test.ts
Expand Up @@ -1469,7 +1469,12 @@ describe("Auto", () => {
auto.hooks.afterShipIt.tap("test", afterShipIt);

await auto.shipit();
expect(afterShipIt).not.toHaveBeenCalled();
expect(afterShipIt).toHaveBeenCalledWith({
dryRun: undefined,
newVersion: undefined,
context: 'latest',
commitsInRelease: [],
});
});

test("should publish to latest on base branch", async () => {
Expand Down
11 changes: 3 additions & 8 deletions packages/core/src/auto.ts
Expand Up @@ -1635,15 +1635,10 @@ export default class Auto {
}
}

if (!publishInfo) {
return;
}

const { newVersion, commitsInRelease, context } = publishInfo;
await this.hooks.afterShipIt.promise({
newVersion,
commitsInRelease,
context,
newVersion: publishInfo?.newVersion,
commitsInRelease: publishInfo?.commitsInRelease || [],
context: publishInfo?.context || releaseType,
dryRun: args.dryRun,
});
}
Expand Down

0 comments on commit c37efe4

Please sign in to comment.