-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(verify-conditions): Added check for non existant package name
re #4
- Loading branch information
1 parent
57bf855
commit dc5f1c1
Showing
3 changed files
with
23 additions
and
6 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
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 |
---|---|---|
|
@@ -3,7 +3,9 @@ const postMessage = require('./postMessage') | |
|
||
module.exports = async (pluginConfig, context) => { | ||
const { logger, nextRelease, options } = context | ||
const { npm_package_name } = context.env | ||
|
||
let package_name = context.env.SEMANTIC_RELEASE_PACKAGE | ||
if (!package_name) package_name = context.env.npm_package_name | ||
|
||
if (!pluginConfig.notifyOnSuccess) { | ||
logger.log('Notifying on success skipped') | ||
|
@@ -17,7 +19,7 @@ module.exports = async (pluginConfig, context) => { | |
type: 'section', | ||
text: { | ||
type: 'mrkdwn', | ||
text: `A new version of \`${npm_package_name}\` has been released!\nCurrent version is *#${ | ||
text: `A new version of \`${package_name}\` has been released!\nCurrent version is *#${ | ||
nextRelease.version | ||
}*` | ||
} | ||
|
@@ -36,7 +38,7 @@ module.exports = async (pluginConfig, context) => { | |
|
||
let slackMessage = { | ||
blocks: messageBlocks, | ||
text: `A new version of ${npm_package_name} has been released!` | ||
text: `A new version of ${package_name} has been released!` | ||
} | ||
|
||
if (options.repositoryUrl.indexOf('[email protected]') !== -1) { | ||
|
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