Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
sylc committed Feb 26, 2023
1 parent 38287f9 commit 3b80cd9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion plugins/changelog/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { join } from "./deps.ts";

import type { ReleasePlugin } from "../../plugin.ts";
import {
Document,
defaultFilters,
Document,
polyfillVersion,
pushHeader,
pushTag,
Expand Down
2 changes: 1 addition & 1 deletion plugins/github/mod.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReleasePlugin } from "../../plugin.ts";
import {
Document,
defaultFilters,
Document,
polyfillVersion,
pushTag,
render,
Expand Down
14 changes: 7 additions & 7 deletions src/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function pushChanges(
commits: Commit[],
style: "github" | "md",
): void {
if (title !== '') doc.sections.push(`### ${title}`);
if (title !== "") doc.sections.push(`### ${title}`);
const list: string[] = [];
for (const commit of commits) {
const { hash } = commit;
Expand Down Expand Up @@ -104,18 +104,18 @@ export function pushTag(
let hasConventionalCommit = false;
// capture all commits by their types
for (const filter of filters) {
let title = filter.title
let title = filter.title;
let filtered;
if (filter.type === '!') {
if (filter.type === "!") {
// process breaking change
filtered = commits.filter((commit) => commit.cc.type?.endsWith('!'));
if (filtered.length > 0) hasConventionalCommit = true
filtered = commits.filter((commit) => commit.cc.type?.endsWith("!"));
if (filtered.length > 0) hasConventionalCommit = true;
} else if (filter.type !== "") {
// use conventional commmits as defined in filters
filtered = commits.filter((commit) =>
commit.cc.type?.toLocaleLowerCase() === filter.type.toLocaleLowerCase()
);
if (filtered.length > 0) hasConventionalCommit = true
if (filtered.length > 0) hasConventionalCommit = true;
} else {
// capture other commits
const types = filters.map((f) => f.type);
Expand All @@ -125,7 +125,7 @@ export function pushTag(
}
if (filtered.length > 0) {
if (!hasConventionalCommit) {
title = ''
title = "";
}
pushChanges(doc, repo, title, filtered, style);
}
Expand Down

0 comments on commit 3b80cd9

Please sign in to comment.