Grunt plugin for the npm github-release-notes
npm install @silvapav/grunt-github-release-notes
> Grunt module to publish release notes based on commits between two tags.
This module is using github-release-notes.
~0.4.5 and github-release-notes ^0.5.0``shell`
npm install grunt-github-release-notes --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
`js`
grunt.loadNpmTasks('grunt-github-release-notes');
Before you can use it, you need to set up a couple of things.
gren by default looks for your local git configuration to get the repo informations. This means you can run the command directly from the git repo folder.
Otherwise, you can run it from wherever and specify a different repo as target, with:
`js`
options: {
username: USERNAME,
repo: REPO_NAME
}
#### Token
To work, gren needs a github token (that can be easily generated following this link). _You only need "repo" scope._
Once generated, you can run the gren command with the token as variable:
`js`
options: {
token: YOUR_TOKEN_HERE
}
Or you can add it to your ~/.bash_profile or ~/.zshrc) as follows:
`shell`
export GREN_GITHUB_TOKEN=your_token_here
The options are the same as github-release-notes, in camelCase:
- tags: 0.1.0|0.2.0,0.1.0 A specific tag or the range of tags to build the release notes from.timeWrap: latest|history
- The release notes you want to include in the changelog. Default: latest _Only applicable to the changelog action_changelogFilename: CHANGELOG.md
- The name of the changelog file. Default: CHANGELOG.mddataSource: issues|commits
- The informations you want to use to build release notes. Default: issuesdraft: true|false
- To set the release as a draft. Default: falseprerelease: true|false
- To set the release as a prerelease. Default: falseprefix: v
- Add a prefix to the tag version e.g. v1.0.1. Default: nullincludeMessages: merges|commits|all
- used to filter the messages added to the release notes. Default: commitsoverride: true|false
- Override the release notes if existing. Default: false
The module accepts two targets: release and changelog.
The release task will generate the last release, while the changelog will add the release notes to the changelog (without committing the file);
`js``
gren: {
release: {
options: {
prefix: 'v'
}
},
changelog: {
options: {
changelogFilename: 'CHANGELOG.md'
}
}
}