A release note generator that reads and parses git commits and retrieves issue links from GitHub.
releaser --dir <directory> --upstream <owner>/<repo> --token <token>
--config [value] configuration file in js
--dir <value> read commits and tags from this local git directory
--upstream <value> GitHub <owner>/<repo>
--token <value> GitHub token
--tag [value] get changelog from this tag
--type [value] Type of new release (semver)
-h, --help output usage information
By default, it expects the commits and tags to follow a specific format.
Tags are expected to follow the semver convention as v1.0.0
. It is customizable through the tagRegex
configuration option.
Commits are expected to follow the following convention:
/(Fix|Close|Resolve) #(\d+)/g
: A commit name that matches this regex will automatically be resolved to the corresponding GitHub issue with the title of the issue as the name of the change. This is overridable through theissueRegex
parameter in a configuration file.Hotfix - Message
: A commit name that starts withHotfix
will get included asothers
with Message as the name of the change. This is customisable through thelabels > local
parameter in a configuration file.
By default, only issues that contain the labels [Bug, Feature]
will be included in the release notes. This is customisable through the externalLabels
parameter in a configuration file.
By default, the changelog is rendered in markdown. It is possible to override the rendering functions through the configuration file.
Example releaser.config.js
:
module.exports = {
upstream: 'ProtonMail/WebClient',
dir: '.',
rotate: 5,
tagRegex: 'v\d+.\d+.\d+',
labels: {
external: [{ match: 'Enhancement', name: 'Features' }, { match: 'Bug', name: 'Bugs' }],
local: [{ match: /Hotfix [-~]? ?/, name: 'Others' }]
},
render: {
commit: function commit({ title, issueNumber, name }) {
const issue = (number) => number && `#${number} ` || '';
return `* ${issue(issueNumber)}${title || name}`;
}
}
};
Mattias Svanström (@mmso) - ProtonMail