From 216b2d3a8a21e7adb71138e09c9f6ae98b7a7975 Mon Sep 17 00:00:00 2001 From: talyak Date: Tue, 20 Mar 2018 10:34:35 +0200 Subject: [PATCH] add semantic-release configuration --- semantic_release/analyzeCommits.js | 9 +++++++++ semantic_release/verifyConditions.js | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 semantic_release/analyzeCommits.js create mode 100644 semantic_release/verifyConditions.js diff --git a/semantic_release/analyzeCommits.js b/semantic_release/analyzeCommits.js new file mode 100644 index 0000000..1701ca5 --- /dev/null +++ b/semantic_release/analyzeCommits.js @@ -0,0 +1,9 @@ +function isBreakingChange(commit) { + return commit.message.toLowerCase().includes('breaking changes'); +} + +module.exports = function (pluginConfig, {commits}, callback) { + const breakingChanges = commits.some((commit) => isBreakingChange(commit)); + + callback(null, breakingChanges ? 'minor' : 'patch'); +}; \ No newline at end of file diff --git a/semantic_release/verifyConditions.js b/semantic_release/verifyConditions.js new file mode 100644 index 0000000..9b66b03 --- /dev/null +++ b/semantic_release/verifyConditions.js @@ -0,0 +1,5 @@ +module.exports = function (pluginConfig, config, callback) { + + // we have no conditions to verify + callback(null); +}; \ No newline at end of file