Skip to content

Commit 5238e79

Browse files
committed
feat(getMostRecentTags): add fetchRemote option to allow disabling remote fetching
1 parent 361c7f0 commit 5238e79

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/update-changelog.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,22 @@ import { PackageRename } from './shared-types';
1111
* Get the most recent tag for a project.
1212
*
1313
* @param options - Options.
14+
* @param options.fetchRemote - Whether to synchronize local tags with remote.
1415
* @param options.tagPrefixes - A list of tag prefixes to look for, where the first is the intended
1516
* prefix and each subsequent prefix is a fallback in case the previous tag prefixes are not found.
1617
* @returns The most recent tag.
1718
*/
1819
async function getMostRecentTag({
20+
fetchRemote = true,
1921
tagPrefixes,
2022
}: {
23+
fetchRemote: boolean;
2124
tagPrefixes: [string, ...string[]];
2225
}) {
2326
// Ensure we have all tags on remote
24-
await runCommand('git', ['fetch', '--tags']);
27+
if (fetchRemote) {
28+
await runCommand('git', ['fetch', '--tags']);
29+
}
2530

2631
let mostRecentTagCommitHash: string | null = null;
2732
for (const tagPrefix of tagPrefixes) {

0 commit comments

Comments
 (0)