fix: check that repositoryUrl starts with github.com

This commit is contained in:
Rhys Arkins 2018-02-08 13:32:27 +01:00
parent 82ec20d35d
commit e795dc5a86

View file

@ -53,7 +53,11 @@ async function getChangeLogJSON(depName, fromVersion, newVersion) {
logger.debug('Checking for github source URL manually'); logger.debug('Checking for github source URL manually');
const dep = await npmRegistry.getDependency(depName); const dep = await npmRegistry.getDependency(depName);
// istanbul ignore if // istanbul ignore if
if (dep && dep.repositoryUrl) { if (
dep &&
dep.repositoryUrl &&
dep.repositoryUrl.startsWith('https://github.com/')
) {
logger.info('Found github URL manually'); logger.info('Found github URL manually');
const github = dep.repositoryUrl const github = dep.repositoryUrl
.replace('https://github.com/', '') .replace('https://github.com/', '')