File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -281,9 +281,26 @@ export class Releaser<
281281 gitClient
282282 } = this
283283 const { dryRun } = this . options
284+ const {
285+ fetch,
286+ ...tagOptions
287+ } = {
288+ ...this . stepsOptions . tag ,
289+ ...options
290+ }
284291
285292 logger . info ( 'tag' , 'Tagging version...' )
286293
294+ if ( fetch ) {
295+ logger . verbose ( 'tag' , 'Fetching fresh tags from the remote repository...' )
296+
297+ if ( ! dryRun ) {
298+ await gitClient . fetch ( {
299+ tags : true
300+ } )
301+ }
302+ }
303+
287304 const tags = await project . getTags ( )
288305
289306 this . state . tags = tags . length > 0
@@ -300,8 +317,7 @@ export class Releaser<
300317
301318 if ( ! dryRun ) {
302319 await gitClient . tag ( {
303- ...this . stepsOptions . tag ,
304- ...options ,
320+ ...tagOptions ,
305321 name : tag
306322 } )
307323 }
Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ export interface ReleaserCheckoutOptions {
5454
5555export type ReleaserCommitOptions = Omit < GitCommitParams , 'verify' | 'files' | 'message' >
5656
57- export type ReleaserTagOptions = Omit < GitTagParams , 'name' | 'message' >
57+ export interface ReleaserTagOptions extends Omit < GitTagParams , 'name' | 'message' > {
58+ /**
59+ * Fetch fresh tags from the remote repository before tagging.
60+ */
61+ fetch ?: boolean
62+ }
5863
5964export type ReleaserPushOptions = Omit < GitPushParams , 'verify' | 'tags' | 'followTags' >
6065
You can’t perform that action at this time.
0 commit comments