Skip to content

Commit b4dd280

Browse files
acalcuttSusheer
andauthored
Add --commitish option to specify target_commitish branch (#13)
* Add --commitish option to specify target_commitish branch * default to main --------- Co-authored-by: Sudheer gupta <Sudheergupta0508@gmail.com>
1 parent c58bf7f commit b4dd280

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ Instead of ```node-pre-gyp publish``` use **```node-pre-gyp-github publish```**
1313

1414
* --silent : Turns verbose messages off.
1515
* --release : Publish the GitHub Release immediately instead of creating a Draft.
16-
1716
For Ex. ```node-pre-gyp-github publish --release```
17+
* --commitish : Defines the branch to be used for the target_commitish parameter. Defaults to 'main' if omitted.
18+
For Ex. ```node-pre-gyp-github publish --commitish main ```
19+
20+
1821

1922
## Install
2023

bin/node-pre-gyp-github.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@ program
88
.description("publishes the contents of ./build/stage/{version} to the current version's GitHub release")
99
.option("-r, --release", "publish immediately, do not create draft")
1010
.option("-s, --silent", "turns verbose messages off")
11+
.option("-c, --commitish <branch>", "specify the branch for target_commitish, defaults to 'main'")
1112
.action(async (options) => {
1213
const opts = {
1314
draft: !options.release,
1415
verbose: !options.silent,
16+
commitish: options.commitish || 'main'
1517
};
1618
try {
1719
const nodePreGypGithub = new NodePreGypGithub();

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export default class NodePreGypGithub {
6464
owner: this.owner,
6565
repo: this.repo,
6666
tag_name: this.package_json.version,
67-
target_commitish: 'main',
67+
target_commitish: args.commitish,
6868
name: 'node-v' + this.package_json.version,
6969
body: this.package_json.name + ' ' + this.package_json.version,
7070
draft: true,

0 commit comments

Comments
 (0)