Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
runStep({ title: 'Checking the current status.' }, () => {
const {
mergeStrategy,
formatPullRequestTitle,
shouldRelease,
monorepo,
} = config;
const commitMessage = getLatestCommitMessage(dir);
const currentVersion =
monorepo && monorepo.mainVersionFile
? getCurrentVersion(dir, monorepo.mainVersionFile)
: getCurrentVersion(dir);
const currentBranch = getCurrentBranch(dir);
const validationResult = shouldRelease({
commitMessage,
currentVersion,
currentBranch,
mergeStrategy,
formatPullRequestTitle,
});
if (validationResult !== true) {
print(warning('Skipping a release due to the following reason:'));
print(info(` > ${validationResult}`));
exitProcess(0);
}
return {
currentVersion,
runStep({ title: 'Checking the current status.' }, () => {
const {
mergeStrategy,
formatPullRequestTitle,
shouldRelease,
monorepo,
} = config;
const commitMessage = getLatestCommitMessage(dir);
const currentVersion =
monorepo && monorepo.mainVersionFile
? getCurrentVersion(dir, monorepo.mainVersionFile)
: getCurrentVersion(dir);
const currentBranch = getCurrentBranch(dir);
const validationResult = shouldRelease({
commitMessage,
currentVersion,
currentBranch,
mergeStrategy,
formatPullRequestTitle,
});
if (validationResult !== true) {
print(warning('Skipping a release due to the following reason:'));
print(info(` > ${validationResult}`));
exitProcess(0);
}
return {
currentVersion,
};
() => {
const { mergeStrategy, monorepo } = config;
const baseBranches = getBaseBranches({ mergeStrategy });
const currentVersion =
monorepo && monorepo.mainVersionFile
? getCurrentVersion(dir, monorepo.mainVersionFile)
: getCurrentVersion(dir);
const result = validateBeforePrepare({
dir,
baseBranches,
});
const baseBranch = getCurrentBranch(dir);
if (result !== true) {
printValidationError({
result,
baseBranches,
});
exitProcess(1);
}
return { currentVersion, baseBranch };
}
);
() => {
const { mergeStrategy, monorepo } = config;
const baseBranches = getBaseBranches({ mergeStrategy });
const currentVersion =
monorepo && monorepo.mainVersionFile
? getCurrentVersion(dir, monorepo.mainVersionFile)
: getCurrentVersion(dir);
const result = validateBeforePrepare({
dir,
baseBranches,
});
const baseBranch = getCurrentBranch(dir);
if (result !== true) {
printValidationError({
result,
baseBranches,
});
exitProcess(1);
}
return { currentVersion, baseBranch };
}
);