Skip to content

Commit 9cf268f

Browse files
committed
feat(simple-github-release): add tag cli option
1 parent 7fe8fcc commit 9cf268f

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

.tool-versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm 8.15.8
2+
nodejs 22.4.1

packages/simple-github-release/src/cli/options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function getOptionsFromArgv(): Options {
2323
option('host', String),
2424
option('changelogLocation', String),
2525
option('releaseName', String),
26+
option('tag', String),
2627
option('draft', Boolean),
2728
option('prerelease', Boolean),
2829
option('auto', Boolean),

packages/simple-github-release/src/cli/release.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import type {
55
} from '../index.js'
66

77
export function getReleaseData(options: Options, context: LocalContext): GitHubRelease {
8+
const tag = options.tag || context.tag
9+
810
return {
911
name: options.releaseName
1012
? options.releaseName
11-
.replace('${tag}', context.tag)
13+
.replace('${tag}', tag)
1214
.replace('${version}', context.version)
13-
: context.tag,
14-
tag: context.tag,
15+
: tag,
16+
tag,
1517
notes: context.notes,
1618
draft: options.draft,
1719
prerelease: options.prerelease,

packages/simple-github-release/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ export interface Options {
3333
* @default '${tag}'
3434
*/
3535
releaseName?: string
36+
/**
37+
* Override release tag.
38+
* @default Latest git tag.
39+
*/
40+
tag?: string
3641
/**
3742
* Create release draft.
3843
* @default false

0 commit comments

Comments
 (0)