Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github-release-notes

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github-release-notes

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

  • 0.6.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
686
decreased by-2.14%
Maintainers
1
Weekly downloads
 
Created
Source

Github Release Notes

npm version js-standard-style Build Status Join the chat at https://gitter.im/github-release-notes/Lobby

Node module that generates release notes based on commit messages or closed issues between tags. It also can create a full changelog or add the latest release notes to the existing changelog file.

If you want to include it in a task, you can use grunt-github-release-notes

Installation

Install github-release-notes via npm:

npm install github-release-notes -g

Usage

gren can be ran through the terminal, but 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:

gren --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:

gren --token=your_token_here

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

export GREN_GITHUB_TOKEN=your_token_here

And you're ready to use it! Just run this command in your terminal:

gren

The module will look for the last tag, get all the issues closed in the time between that tag and the one before, and it will build release notes and draft the new release!

Options

Following the options for the module:

Global options

CommandOptionsDescriptionDefault
--usernameRequiredThe username of the repo e.g. github-toolsnull
--repoRequiredThe repository name e.g. github-release-notesnull
--actionrelease changelogThe gren action to run. (see details below for changelog generator)release
--ignore-labelswont_fix wont_fix,duplicateIgnore issues that contains one of the specified labels.false
--ignore-issues-withwont_fix wont_fix,duplicateIgnore issues that contains one of the specified labels.false
--data-sourceissues commitsThe informations you want to use to build release notes.issues
--prefixString e.g. v1.0.1Add a prefix to the tag version.null
--overrideFlagOverride the release notes if existing.false
--include-messagesmerge commits allFilter the messages added to the release notes. _Only used when data-source used is commitscommits

Release options

CommandOptionsDescriptionDefault
--draftFlagSet the release as a draft.false
--prereleaseFlagTo set the release as a prerelease.false
--tags0.1.0 0.2.0,0.1.0 allA specific tag or the range of tags to build the release notes from. You can also specify all to write all releases. (To override existing releases use the --override flag)false

Changelog options

CommandOptionsDescriptionDefault
--time-wraplatest historyThe release notes you want to include in the changelog.latest
--changelog-filenameString, like changelog.mdThe name of the changelog file.CHANGELOG.md

Config file

You can create a configuration file where the task will be ran, where to specify your options. The options in the file would be camelCase e.g:

{
    "action": "release",
    "timeWrap": "history",
    "dataSource": "commits",
    "ignoreIssuesWith": [
        "wontfix",
        "duplicate"
    ]
}

The accepted file extensions are the following:

  • .grenrc
  • .grenrc.json
  • .grenrc.yml
  • .grenrc.yaml
  • .grenrc.js

#### Templates

You can configure the output of gren using templates. Set your own configuration inside the config file, which will be merged with the defaults, shown below:

{
    "template": {
        "commit": "- {{message}}",
        "issue": "- {{labels}} {{name}} {{link}}",
        "issueInfo": {
            "labels": "{{labels}}",
            "label": "[**{{label}}**]",
            "name": "{{name}}",
            "link": "[{{text}}]({{url}})"
        },
        "release": "## {{release}} {{date}}",
        "releaseInfo": {
            "release": "{{release}}",
            "date": "({{date}})"
        }
    }
}

Examples

The ways to use gren are various.

Simple

The simple way, just looks for the last tag, gets all the issues closed between that tag and the one before and creates the new release with the generated body.

gren

Commit messages

Adding the flag --data-source=commits will change the source of the release notes to be the commit messages.

gren --data-source=commits

Release specific tags

The flag --tags accepts one or two tags. If you only give one tag, it will get the issues (or commit messages) between that tag and the one before. If you give two tags it will generate the release notes with the issues (or commit messages) between those two tag dates.

gren --tags=2.0.0,1.0.0

Override an existing release

If you trying to create an existing release, gren will throw an error "0.3.0 is a release, use --override flag to override an existing release! If you want then to override, simple use:

gren --override --tags=0.3.0

Write all existing tags

You can run the task to generate release notes for all existing tags. Releases that already exist will be skipped. To override them, use the flag --override

gren --override --tags=all

Changelog Generator

gren can also update generate the changelog.

The following command, will get the latest release notes, and add it to an existing file or create it in the same directory where you run the command.

gren --action=changelog

The generated release notes will be added at the top of the file, and will look like this:

Changelog

v0.4.3 (02/03/2016)

[bug] This is a issue name #123

Generate a full changelog

If tou want to generate the whole changelog, you need to use the --time-wrap=history. This will generate the changelog based on all release notes.

If you want to override the existing changelog, use --override. This will also generate the release notes from scratch.

The usage would then be:

gren --action=changelog --time-wrap=history --override

To see a full example of the changelog here CHANGELOG.md


JavaScript documentation

Find the full documentation for JavaScript function here: http://github-tools.github.io/github-release-notes/

Keywords

FAQs

Package last updated on 13 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc