Skip to content

Commit b9bbd9e

Browse files
committed
fix(projects): fix get to value
1 parent d510e9c commit b9bbd9e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Presets, SingleBar } from 'cli-progress';
22
import { createOptions } from './options';
3-
import { getFromToTags, getGitCommits, getGitCommitsAndResolvedAuthors } from './git';
3+
import { getCurrentGitBranch, getFromToTags, getGitCommits, getGitCommitsAndResolvedAuthors } from './git';
44
import { generateMarkdown, isVersionInMarkdown, writeMarkdown } from './markdown';
55
import type { ChangelogOption } from './types';
66

@@ -13,7 +13,10 @@ import type { ChangelogOption } from './types';
1313
export async function getChangelogMarkdown(options?: Partial<ChangelogOption>, showTitle = true) {
1414
const opts = await createOptions(options);
1515

16-
const gitCommits = await getGitCommits(opts.from, opts.to);
16+
const current = await getCurrentGitBranch();
17+
const to = opts.tags.includes(opts.to) ? opts.to : current;
18+
19+
const gitCommits = await getGitCommits(opts.from, to);
1720
const resolvedLogins = new Map<string, string>();
1821
const { commits, contributors } = await getGitCommitsAndResolvedAuthors(gitCommits, opts.github, resolvedLogins);
1922

0 commit comments

Comments
 (0)