/
pr.config.js
32 lines (26 loc) · 884 Bytes
/
pr.config.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
// @ts-nocheck
const envCi = require('env-ci');
const defaultConfig = require('./config');
const { branches } = require('./merge.config');
const { plugin } = require(process.cwd());
const { prBranch, branch } = envCi();
const config = {
...defaultConfig,
dryRun: true,
ci: false,
branches: [branch, prBranch].filter(Boolean),
};
const pluginOptions = {};
if (branches !== undefined) {
pluginOptions.releaseBranches = branches;
}
// If we're triggered by PR and merging to allowed branch, we generate and
// commit CHANGELOG.md so it can still be review before the merge.
config.plugins = [
// Plugin calls release-notes-generator, changelog and git plugins itself,
// so we don't have to include them here. But the plugin must be BEFORE
// the commit-analyzer plugin.
[plugin, pluginOptions],
'@semantic-release/commit-analyzer',
];
module.exports = config;