Skip to content

Commit 5dfe817

Browse files
committed
comeon
1 parent c282fe3 commit 5dfe817

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/index.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface ChangesetWithPR extends NewChangesetWithCommit {
1212

1313
// Keep track of all authors across changesets
1414
let allAuthors = new Set<string>();
15-
let isLastPatch = false;
15+
let patchChanges = new Set<string>();
1616

1717
async function getReleaseLine(
1818
changeset: ChangesetWithPR,
@@ -211,9 +211,16 @@ const wrappedGetReleaseLine: ChangelogFunctions["getReleaseLine"] = async (
211211
console.log(`[Debug] Current authors: ${Array.from(allAuthors).join(", ")}`);
212212
const result = await getReleaseLine(changeset as ChangesetWithPR, type, opts);
213213

214-
// Add credits section only to patch changes or when isLast is true
215-
if ((opts?.isLast || type === "patch") && allAuthors.size > 0) {
214+
// Track patch changes
215+
if (type === "patch") {
216+
patchChanges.add(changeset.summary);
217+
}
218+
219+
// Add credits section only if this is the last entry and we have authors
220+
if (opts?.isLast && allAuthors.size > 0) {
216221
console.log(`[Debug] Adding credits section for ${type} changes`);
222+
// Clear patch changes for next changelog
223+
patchChanges.clear();
217224
return result + getCreditsSection();
218225
}
219226
return result;
@@ -235,6 +242,8 @@ const wrappedGetDependencyReleaseLine: ChangelogFunctions["getDependencyReleaseL
235242
// Add credits section only if this is the last entry and we have authors
236243
if (opts?.isLast && allAuthors.size > 0) {
237244
console.log(`[Debug] Adding credits section for dependency changes`);
245+
// Clear patch changes for next changelog
246+
patchChanges.clear();
238247
return result + getCreditsSection();
239248
}
240249
return result;

0 commit comments

Comments
 (0)