Skip to content

Commit

Permalink
fix(Changelog): Remove empty releases from changlelog
Browse files Browse the repository at this point in the history
  • Loading branch information
sylc committed Jun 12, 2022
1 parent 5fa357d commit b76c830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tasks": {
"test": "deno run -A ./cli.ts --dry --allowUncommitted --regex \"(?<=@)(.*)(?=\/cli)\"",
"test": "deno run -A ./cli.ts --dry --allowUncommitted --regex \"(?<=@)(.*)(?=\/cli)\" --changelog --github",
"release": "deno fmt --check && deno lint && deno run -A ./cli.ts --regex \"(?<=@)(.*)(?=\/cli)\" --github --versionFile --changelog"
},
"fmt": {
Expand Down
8 changes: 7 additions & 1 deletion plugins/changelog/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ const plugin: ReleasePlugin = {
for (let i = 0; i < tags.length; i++) {
const tag = tags[i];
const belonging = commits.filter((_) => _.belongs?.hash === tag.hash);
pushTag(doc, repo, belonging, filters, tag, "md");
const filteredTypes = filters.map((f) => f.type);
const filteredCommits = belonging.filter((_) =>
filteredTypes.includes(_.cc.type || "")
);
if (filteredCommits.length) {
pushTag(doc, repo, belonging, filters, tag, "md");
}
}

const md = render(doc);
Expand Down

0 comments on commit b76c830

Please sign in to comment.