Skip to content

Commit 14d1d38

Browse files
committed
Create release without Changelog if changelog does not exist
1 parent 6c2eb83 commit 14d1d38

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/publish.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,13 @@ const provenance = visibility.toLowerCase() === "public" ? "--provenance" : "";
5353
execSync(`cd lib && pnpm build && npm publish ${provenance} --access public`);
5454

5555
/** Create GitHub release */
56-
execSync(
57-
`gh release create ${VERSION} --generate-notes --latest -n "$(sed '1,/^## /d;/^## /,$d' CHANGELOG.md)" --title "Release v${VERSION}"`,
58-
);
56+
try {
57+
execSync(
58+
`gh release create ${VERSION} --generate-notes --latest -n "$(sed '1,/^## /d;/^## /,$d' CHANGELOG.md)" --title "Release v${VERSION}"`,
59+
);
60+
} catch {
61+
execSync(`gh release create ${VERSION} --generate-notes --latest --title "Release v${VERSION}"`);
62+
}
5963

6064
execSync("node ./scripts/lite.js");
6165
execSync(`cd lib && pnpm build && npm publish ${provenance} --access public`);

0 commit comments

Comments
 (0)