Skip to content

Instantly share code, notes, and snippets.

@frapontillo
Created June 30, 2015 08:44
Show Gist options
  • Save frapontillo/81599700949d9648efed to your computer and use it in GitHub Desktop.
Save frapontillo/81599700949d9648efed to your computer and use it in GitHub Desktop.
gulp-conventional-changelog
var gulp = require('gulp');
var conventionalChangelog = require('conventional-changelog');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var addsrc = require('gulp-add-src');
var concat = require('gulp-concat');
/**
* Creates a `changelog` task, that will process all commits from the latest tag
* and generates a CHANGELOG.md file by appending the old contents to it.
*/
gulp.task('changelog', function () {
return conventionalChangelog({
preset: 'angular'
})
.pipe(source('.'))
.pipe(buffer())
.pipe(addsrc.append('CHANGELOG.md'))
.pipe(concat('CHANGELOG.md'))
.pipe(gulp.dest('.'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment