BREAKING CHANGE: `success` and `fail` hooks are now enabled by default In order to disable the `@semantic-release/github` plugin for the `success` and `fail` hook, the corresponding options have to be set to `false` in the **semantic-release** configuration: ```json { "release": { "success": false, "fail": false } } ``` Users who do not use the `@semantic-release/github` plugin, should disable it in the `success` and `fail` by setting the corresponding options to `false` or to alternative plugin providing `success` and `fail` hooks.
62 lines
1.9 KiB
JavaScript
62 lines
1.9 KiB
JavaScript
const {isString, isFunction, isArray, isPlainObject} = require('lodash');
|
|
const RELEASE_TYPE = require('./release-types');
|
|
|
|
const validatePluginConfig = conf => isString(conf) || isString(conf.path) || isFunction(conf);
|
|
|
|
module.exports = {
|
|
verifyConditions: {
|
|
default: ['@semantic-release/npm', '@semantic-release/github'],
|
|
config: {
|
|
validator: conf => !conf || (isArray(conf) ? conf : [conf]).every(conf => validatePluginConfig(conf)),
|
|
},
|
|
},
|
|
analyzeCommits: {
|
|
default: '@semantic-release/commit-analyzer',
|
|
config: {
|
|
validator: conf => Boolean(conf) && validatePluginConfig(conf),
|
|
},
|
|
output: {
|
|
validator: output => !output || RELEASE_TYPE.includes(output),
|
|
error: 'EANALYZEOUTPUT',
|
|
},
|
|
},
|
|
verifyRelease: {
|
|
default: false,
|
|
config: {
|
|
validator: conf => !conf || (isArray(conf) ? conf : [conf]).every(conf => validatePluginConfig(conf)),
|
|
},
|
|
},
|
|
generateNotes: {
|
|
default: '@semantic-release/release-notes-generator',
|
|
config: {
|
|
validator: conf => !conf || validatePluginConfig(conf),
|
|
},
|
|
output: {
|
|
validator: output => !output || isString(output),
|
|
error: 'ERELEASENOTESOUTPUT',
|
|
},
|
|
},
|
|
publish: {
|
|
default: ['@semantic-release/npm', '@semantic-release/github'],
|
|
config: {
|
|
validator: conf => Boolean(conf) && (isArray(conf) ? conf : [conf]).every(conf => validatePluginConfig(conf)),
|
|
},
|
|
output: {
|
|
validator: output => !output || isPlainObject(output),
|
|
error: 'EPUBLISHOUTPUT',
|
|
},
|
|
},
|
|
success: {
|
|
default: ['@semantic-release/github'],
|
|
config: {
|
|
validator: conf => !conf || (isArray(conf) ? conf : [conf]).every(conf => validatePluginConfig(conf)),
|
|
},
|
|
},
|
|
fail: {
|
|
default: ['@semantic-release/github'],
|
|
config: {
|
|
validator: conf => !conf || (isArray(conf) ? conf : [conf]).every(conf => validatePluginConfig(conf)),
|
|
},
|
|
},
|
|
};
|