Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const commits = await getCommits(lastRelease.gitHead, config.branch, logger);
const relevantCommits = getRelevantCommits(commits, pkg);
// Store relevant commits for later use
packages[i].commits = relevantCommits;
// Store lastRelease for later use
packages[i]["lastRelease"] = lastRelease;
if (!relevantCommits.length) {
logger.log(`No relevant commits were found for package %s`, pkg.name);
logger.log(`======== Finished processing package ========\n\n`);
continue;
}
const type = await commitAnalyzer(
pluginConfig.analyzeCommits || {},
Object.assign({ logger, commits: relevantCommits })
);
relevantCommits.length &&
logger.log(
`Relevant commits:\n* ${relevantCommits.map(c => c.subject).join("\n* ")}`
);
let version;
if (lastRelease.version) {
version = semver.inc(lastRelease.version, type);
logger.log("The next release version is %s", version);
} else {
version = "1.0.0";
logger.log("There is no previous release, the next release version is %s", version);
}
packages[i]["nextRelease"] = {