diff --git a/README.md b/README.md index 4f778c9..60b2f56 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,11 @@ Instead of ```node-pre-gyp publish``` use **```node-pre-gyp-github publish```** * --silent : Turns verbose messages off. * --release : Publish the GitHub Release immediately instead of creating a Draft. - For Ex. ```node-pre-gyp-github publish --release``` +* --commitish : Defines the branch to be used for the target_commitish parameter. Defaults to 'master' if omitted. + For Ex. ```node-pre-gyp-github publish --commitish main ``` + + ## Install diff --git a/bin/node-pre-gyp-github.js b/bin/node-pre-gyp-github.js index a9c8f5d..5992a97 100755 --- a/bin/node-pre-gyp-github.js +++ b/bin/node-pre-gyp-github.js @@ -8,10 +8,12 @@ program .description("publishes the contents of ./build/stage/{version} to the current version's GitHub release") .option("-r, --release", "publish immediately, do not create draft") .option("-s, --silent", "turns verbose messages off") + .option("-c, --commitish ", "specify the branch for target_commitish, defaults to 'master'") .action(async (options) => { const opts = { draft: !options.release, verbose: !options.silent, + commitish: options.commitish || 'master' }; try { const nodePreGypGithub = new NodePreGypGithub(); diff --git a/index.js b/index.js index 2ee9370..e788216 100644 --- a/index.js +++ b/index.js @@ -64,7 +64,7 @@ module.exports = class NodePreGypGithub { owner: this.owner, repo: this.repo, tag_name: this.package_json.version, - target_commitish: 'master', + target_commitish: args.commitish, name: 'v' + this.package_json.version, body: this.package_json.name + ' ' + this.package_json.version, draft: true,