Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createRelease(type, { tags, releaseNotes }, { gitRemote, execOpts }) {
const repo = parseGitRepo(gitRemote, execOpts);
const client = createClient(type);
return Promise.all(
releaseNotes.map(({ notes, name }) => {
const tag = name === "fixed" ? tags[0] : tags.find(t => t.startsWith(`${name}@`));
/* istanbul ignore if */
if (!tag) {
return Promise.resolve();
}
const prereleaseParts = semver.prerelease(tag.replace(`${name}@`, "")) || [];
return client.repos.createRelease({
owner: repo.owner,
repo: repo.name,