Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: NPM GH release publishing should set latest #2423

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions plugins/npm/__tests__/npm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,7 @@ describe("makeRelease", () => {
logger: dummyLog(),
prefixRelease: (str) => str,
git: { publish } as any,
inOldVersionBranch: (bool) => bool,
release: {
makeChangelog: () => ({
generateReleaseNotes: (commits: IExtendedCommit[]) =>
Expand All @@ -1661,6 +1662,7 @@ describe("makeRelease", () => {
await hooks.makeRelease.promise({
newVersion: "0.1.2",
from: "",
to: "",
isPrerelease: false,
fullReleaseNotes: "",
commits: [
Expand All @@ -1684,12 +1686,16 @@ describe("makeRelease", () => {
expect(publish).toHaveBeenCalledWith(
"update package 1",
"@packages/a",
false
false,
undefined,
true
);
expect(publish).toHaveBeenCalledWith(
"update package 2",
"@packages/b",
false
false,
undefined,
true
);
});
});
Expand Down
8 changes: 7 additions & 1 deletion plugins/npm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,13 @@ export default class NPMPlugin implements IPlugin {
auto.logger.log.info(`Using release notes:\n${releaseNotes}`);

// 2. make a release for just that package
return auto.git?.publish(releaseNotes, tag, options.isPrerelease);
return auto.git?.publish(
releaseNotes,
tag,
options.isPrerelease,
undefined,
!auto.inOldVersionBranch()
);
})
);

Expand Down
Loading