@@ -15,18 +15,19 @@ program
1515 . usage ( '<command> [<args>]' )
1616 . option ( '--baseurl <baseurl>' , 'API endpoint' , 'https://api.github.com' )
1717 . option ( '-T, --token <token>' , 'OAuth2 token' )
18- . option ( '-o, --owner <owner>' , 'owner' )
19- . option ( '-r, --repo <repo>' , 'repo' )
20- . option ( '-t, --tag <tag>' , 'tag' )
21- . option ( '-n, --name <name>' , 'name' )
22- . option ( '-b, --body <body>' , 'body' )
23- . option ( '-d, --draft [value]' , 'draft' , function ( val ) {
18+ . option ( '-o, --owner <owner>' , 'The repository owner.' )
19+ . option ( '-r, --repo <repo>' , 'The repository name.' )
20+ . option ( '-t, --tag <tag>' , 'The name of the tag.' )
21+ . option ( '-c, --commitish <value>' , 'Specifies the commitish value for tag. Unused if the tag already exists.' )
22+ . option ( '-n, --name <name>' , 'The name of the release.' )
23+ . option ( '-b, --body <body>' , 'Text describing the contents of the tag.' )
24+ . option ( '-d, --draft [value]' , '`true` makes the release a draft, and `false` publishes the release.' , function ( val ) {
2425 if ( String ( val ) . toLowerCase ( ) === 'false' ) {
2526 return false ;
2627 }
2728 return true ;
2829 } )
29- . option ( '-p, --prerelease [value]' , 'prerelease' , function ( val ) {
30+ . option ( '-p, --prerelease [value]' , '`true` to identify the release as a prerelease, `false` to identify the release as a full release. ' , function ( val ) {
3031 if ( String ( val ) . toLowerCase ( ) === 'false' ) {
3132 return false ;
3233 }
@@ -64,7 +65,7 @@ function next(response) {
6465
6566const fn = {
6667 'upload' : async ( ) => {
67- const { owner, repo, tag, name, body, draft, prerelease } = program ;
68+ const { owner, repo, tag, commitish , name, body, draft, prerelease } = program ;
6869 const files = args ;
6970 let release ;
7071
@@ -82,11 +83,12 @@ const fn = {
8283
8384 try {
8485 if ( ! release ) {
85- console . log ( `> createRelease: tag_name=${ tag } , name=${ name || tag } , draft=${ ! ! draft } , prerelease=${ ! ! prerelease } ` ) ;
86+ console . log ( `> createRelease: tag_name=${ tag } , target_commitish= ${ commitish } , name=${ name || tag } , draft=${ ! ! draft } , prerelease=${ ! ! prerelease } ` ) ;
8687 const res = await octokit . repos . createRelease ( {
8788 owner,
8889 repo,
8990 tag_name : tag ,
91+ target_commitish : commitish ,
9092 name : name || tag ,
9193 body : body || '' ,
9294 draft : ! ! draft ,
0 commit comments