Skip to content
Merged
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
8 changes: 8 additions & 0 deletions lib/src/Gren.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import templateConfig from './templates.js';
import ObjectAssign from 'object-assign-deep';
import cmp from 'semver-compare';
import fs from 'fs';
import { execSync } from 'child_process';

const defaults = {
tags: [],
Expand Down Expand Up @@ -46,6 +47,13 @@ class Gren {
ignoreTagsWith
} = this.options;

this.options.head = this.options.head || execSync('git symbolic-ref --short HEAD', { encoding: 'utf-8' });
try {
execSync('git rev-parse --abbrev-ref --symbolic-full-name @{u}');
} catch {
this.options.head = execSync("git remote show origin | grep 'HEAD branch' | cut -d' ' -f5", { encoding: 'utf-8' });
}
this.options.head = this.options.head.trim();
this.options.tags = utils.convertStringToArray(tags);
this.options.ignoreLabels = utils.convertStringToArray(ignoreLabels);
this.options.ignoreIssuesWith = utils.convertStringToArray(ignoreIssuesWith);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Create a release from a tag and uses issues or commits to creating the release notes. It also can generate a CHANGELOG.md file based on the release notes (or generate a brand new).",
"main": "./github-release-notes.js",
"scripts": {
"changelog": "node bin/gren.js changelog --override --generate --head master",
"changelog": "node bin/gren.js changelog --override --generate",
"build": "gulp build",
"prerelease": "git clean -xfd && npm ci && npm test && npm run build",
"release": "release-it",
Expand Down