Skip to content

Commit

Permalink
Auto-merge for PR #33 via VersionBot
Browse files Browse the repository at this point in the history
Add versionist config
  • Loading branch information
resin-io-versionbot[bot] authored Jul 27, 2017
2 parents d2565f4 + 3635aa3 commit c41306e
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Change Log

All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).

## v2.8.4 - 2017-07-27

* Add versionist config [John (Jack) Brown]

# 2.8.3

* Update node to 6.11.1
Expand Down
64 changes: 64 additions & 0 deletions versionist.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
'use strict';

const execSync = require('child_process').execSync;

const getAuthor = (commitHash) => {
return execSync(`git show --quiet --format="%an" ${commitHash}`, {
encoding: 'utf8'
}).replace('\n', '');
};

module.exports = {
// This setup allows the editing and parsing of footer tags to get version and type information,
// as well as ensuring tags of the type 'v<major>.<minor>.<patch>' are used.
// It increments in a semver compatible fashion.
editChangelog: true,
parseFooterTags: true,
getGitReferenceFromVersion: 'v-prefix',
incrementVersion: 'semver',
editVersion: false,

// Always add the entry to the top of the Changelog, below the header.
addEntryToChangelog: {
preset: 'prepend',
fromLine: 6
},

// Only include a commit when there is a footer tag of 'change-type'.
// Ensures commits which do not up versions are not included.
includeCommitWhen: (commit) => {
return !!commit.footer['change-type'];
},

// Determine the type from 'change-type:' tag.
// Should no explicit change type be made, then no changes are assumed.
getIncrementLevelFromCommit: (commit) => {
if (commit.footer['change-type']) {
return commit.footer['change-type'].trim();
}
},

// If a 'changelog-entry' tag is found, use this as the subject rather than the
// first line of the commit.
transformTemplateData: (data) => {
data.commits.forEach((commit) => {
commit.subject = commit.footer['changelog-entry'] || commit.subject;
commit.author = getAuthor(commit.hash);
});

return data;
},

template: [
'## v{{version}} - {{moment date "Y-MM-DD"}}',
'',
'{{#each commits}}',
'{{#if this.author}}',
'* {{capitalize this.subject}} [{{this.author}}]',
'{{else}}',
'* {{capitalize this.subject}}',
'{{/if}}',
'{{/each}}'
].join('\n')
};

0 comments on commit c41306e

Please sign in to comment.