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<
281
281
gitClient
282
282
} = this
283
283
const { dryRun } = this . options
284
+ const {
285
+ fetch,
286
+ ...tagOptions
287
+ } = {
288
+ ...this . stepsOptions . tag ,
289
+ ...options
290
+ }
284
291
285
292
logger . info ( 'tag' , 'Tagging version...' )
286
293
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
+
287
304
const tags = await project . getTags ( )
288
305
289
306
this . state . tags = tags . length > 0
@@ -300,8 +317,7 @@ export class Releaser<
300
317
301
318
if ( ! dryRun ) {
302
319
await gitClient . tag ( {
303
- ...this . stepsOptions . tag ,
304
- ...options ,
320
+ ...tagOptions ,
305
321
name : tag
306
322
} )
307
323
}
Original file line number Diff line number Diff line change @@ -54,7 +54,12 @@ export interface ReleaserCheckoutOptions {
54
54
55
55
export type ReleaserCommitOptions = Omit < GitCommitParams , 'verify' | 'files' | 'message' >
56
56
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
+ }
58
63
59
64
export type ReleaserPushOptions = Omit < GitPushParams , 'verify' | 'tags' | 'followTags' >
60
65
You can’t perform that action at this time.
0 commit comments