Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 3193d29

Browse files
author
Bender
committed
fix(git): fetch tags to ensure up-to-date git
1 parent c447488 commit 3193d29

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: lib/cli/shipit.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ interface Props {
1313

1414
export const shipitHandler = async ({ gitEmail, gitUser, tagPrefix, failOnMissingCommit, forceBump, releaseBranchPrefix }: Props) => {
1515
const git = simpleGit()
16-
await git.pull()
1716

18-
const tags = await git.tags({ '--sort': '-creatordate' })
17+
// Fetch tags to ensure we have the latest ones.
18+
const tags = await git.fetch(['--tags']).tags({ '--sort': '-creatordate' })
1919
const log = await git.log({ '--max-count': 20 })
2020
const branch = await git.branch()
2121
const [remote] = await git.getRemotes()
@@ -35,6 +35,7 @@ export const shipitHandler = async ({ gitEmail, gitUser, tagPrefix, failOnMissin
3535
throw new Error('Latest commit was not found!')
3636
}
3737

38+
// @TODO: Fetch all in case from is 0.0.0 (non-existent).
3839
const commits = await git.log({
3940
from: tags.latest,
4041
to: latestCommit,
@@ -57,7 +58,7 @@ export const shipitHandler = async ({ gitEmail, gitUser, tagPrefix, failOnMissin
5758

5859
console.log('Bumps: ', bumps)
5960

60-
// Bump minor in case nothing is found.
61+
// Bump patch in case nothing is found.
6162
if (bumps.length < 1 && forceBump) {
6263
console.log('Forcing patch bump!')
6364
bumps.push(BumpType.Patch)

0 commit comments

Comments
 (0)