Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --commitish option to specify target_commitish branch #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions bin/node-pre-gyp-github.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <branch>", "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();
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down