Skip to content

Commit 63cd986

Browse files
Tenzeraktau
authored andcommitted
Add option to specify the target commit or branch when creating a release
1 parent 130a7b5 commit 63cd986

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

cmd.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ func releasecmd(opt Options) error {
258258
tag := cmdopt.Tag
259259
name := nvls(cmdopt.Name, tag)
260260
desc := nvls(cmdopt.Desc, tag)
261+
target := nvls(cmdopt.Target)
261262
draft := cmdopt.Draft
262263
prerelease := cmdopt.Prerelease
263264

@@ -268,11 +269,12 @@ func releasecmd(opt Options) error {
268269
}
269270

270271
params := ReleaseCreate{
271-
TagName: tag,
272-
Name: name,
273-
Body: desc,
274-
Draft: draft,
275-
Prerelease: prerelease,
272+
TagName: tag,
273+
TargetCommitish: target,
274+
Name: name,
275+
Body: desc,
276+
Draft: draft,
277+
Prerelease: prerelease,
276278
}
277279

278280
/* encode params as json */

github-release.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type Options struct {
3838
Tag string `goptions:"-t, --tag, obligatory, description='Git tag to create a release from'"`
3939
Name string `goptions:"-n, --name, description='Name of the release (defaults to tag)'"`
4040
Desc string `goptions:"-d, --description, description='Description of the release (defaults to tag)'"`
41+
Target string `goptions:"-c, --target, description='Commit SHA or branch to create release of (defaults to the repository default branch)'"`
4142
Draft bool `goptions:"--draft, description='The release is a draft'"`
4243
Prerelease bool `goptions:"-p, --pre-release, description='The release is a pre-release'"`
4344
} `goptions:"release"`

0 commit comments

Comments
 (0)