forked from imbhargav5/rooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.js
52 lines (50 loc) · 1.44 KB
/
Gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
var gulp = require('gulp');
var conventionalChangelog = require('gulp-conventional-changelog');
const IGNORE_COMMIT_PATTERS = [`[skip ci]`, `[create-pull-request]`];
gulp.task('changelog', function () {
var argv = require('yargs').argv;
const { releaseCount = 0 } = argv;
return gulp
.src('CHANGELOG.md')
.pipe(
conventionalChangelog(
{
// conventional-changelog options go here
//preset: 'angular'
releaseCount: releaseCount,
skipUnstable: true,
sameFile: true,
},
{
// context goes here
},
{
// git-raw-commits options go here
},
{
// conventional-commits-parser options go here
},
{
// conventional-changelog-writer options go here
finalizeContext: (context) => {
return {
...context,
commitGroups: [
...context.commitGroups.map(({ commits, ...rest }) => ({
...rest,
commits: commits.filter((commit) => {
return !IGNORE_COMMIT_PATTERS.some((pattern) =>
typeof commit.header === 'string'
? commit.header.includes(pattern)
: false
);
}),
})),
],
};
},
}
)
)
.pipe(gulp.dest('./'));
});