Skip to content

Grunt module to publish release notes based on commits between the last two tags.

License

Notifications You must be signed in to change notification settings

github-tools/grunt-github-release-notes

Repository files navigation

Grunt Github Release Notes

npm version

Grunt module to publish release notes based on commits between two tags. This module is using github-release-notes.

Getting Started

This plugin requires Grunt ~0.4.5 and github-release-notes ^0.5.0

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:

grunt.loadNpmTasks('grunt-github-release-notes');

The "release" task

Before you can use it, you need to set up a couple of things.

Github Informations

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:

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:

options: {
    token: YOUR_TOKEN_HERE
}

Or you can add it to your ~/.bash_profile or ~/.zshrc) as follows:

export GREN_GITHUB_TOKEN=your_token_here

Options

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.md
  • dataSource: issues|commits The informations you want to use to build release notes. Default: issues
  • draft: true|false To set the release as a draft. Default: false
  • prerelease: true|false To set the release as a prerelease. Default: false
  • prefix: v Add a prefix to the tag version e.g. v1.0.1. Default: null
  • includeMessages: merges|commits|all used to filter the messages added to the release notes. Default: commits
  • override: true|false Override the release notes if existing. Default: false

Example

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);

gren: {
    release: {
        options: {
            prefix: 'v'
        }
    },
    changelog: {
        options: {
            changelogFilename: 'CHANGELOG.md'
        }
    }
}

About

Grunt module to publish release notes based on commits between the last two tags.

Resources

License

Stars

Watchers

Forks

Packages

No packages published