-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow defer-release keyword in commit messages (#161)
* feat: allow defer-release keyword in commit messages * fix: halt release process with exit code 0 when defer * refactor(release): allow space or dash in tag
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
packages/utils/src/support/semantic-release-defer-release.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const SemanticReleaseError = require('@semantic-release/error') | ||
|
||
const analyzeCommits = (config = {}, context) => { | ||
const { logger, commits } = context | ||
|
||
const { message, commit } = commits[0] | ||
const defer = /\[defer[ -]release\]/gi | ||
|
||
if (message.match(defer)) { | ||
logger.warn(`This release has been deferred by commit ${commit.short}`) | ||
logger.complete('Halting release process...') | ||
process.exit(0) | ||
} | ||
} | ||
|
||
module.exports = { analyzeCommits } |