github-release-notes
Advanced tools
Comparing version 0.3.2 to 0.3.3
{ | ||
"name": "github-release-notes", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"description": "Node module to publish release notes based on commits between the last two tags.", | ||
@@ -30,2 +30,2 @@ "main": "./github-release-notes.js", | ||
} | ||
} | ||
} |
@@ -20,3 +20,3 @@ 'use strict'; | ||
function makeRelease(gren, releaseOptions) { | ||
return new Promise(function (resolve, reject) { | ||
return new Promise(function (resolve, reject) { | ||
gren.repo.makeRelease(releaseOptions, function (err, release) { | ||
@@ -69,3 +69,3 @@ if(err) { | ||
*/ | ||
function prepareRelease(gren, tags, commitMessages) { | ||
function prepareRelease(gren, tagName, commitMessages) { | ||
var body = commitMessages | ||
@@ -80,4 +80,4 @@ .slice(0, -1) | ||
var releaseOptions = { | ||
tag_name: tags[0].name, | ||
name: (gren.options.prefix || '') + tags[0].name, | ||
tag_name: tagName, | ||
name: (gren.options.prefix || '') + tagName, | ||
body: body, | ||
@@ -153,3 +153,3 @@ draft: gren.options.draft || false, | ||
var filteredTags = tags.filter(function(tag, index) { | ||
return index === 0 || tag.name === releaseTagName; | ||
return index === 0 || (releaseTagName ? tag.name === releaseTagName : index === tags.length-1 ); | ||
}); | ||
@@ -173,6 +173,10 @@ | ||
gren.repo.getLatestRelease(function (err, release) { | ||
if(err) { | ||
if(err && err.request.status !== 404) { | ||
reject(err); | ||
} else { | ||
resolve(release.tag_name); | ||
if(err && err.request.status === 404) { | ||
resolve(false); | ||
} else { | ||
resolve(release.tag_name); | ||
} | ||
} | ||
@@ -224,2 +228,3 @@ }); | ||
var that = this; | ||
var tagName; | ||
@@ -235,2 +240,4 @@ return getLatestRelease(this) | ||
tagName = tags[0].name; | ||
return Promise.all(getTagDates(that, tags[0], tags[1])); | ||
@@ -242,3 +249,3 @@ }) | ||
.then(function (commitMessages) { | ||
return prepareRelease(that, tags, commitMessages); | ||
return prepareRelease(that, tagName, commitMessages); | ||
}) | ||
@@ -245,0 +252,0 @@ .then(function (success) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8561
230