auto-release-cli
Advanced tools
Comparing version 2.5.6 to 2.5.7
@@ -0,1 +1,13 @@ | ||
# v2.5.7 (Fri Jan 18 2019) | ||
#### 🐛 Bug Fix | ||
- When there are no releases use first commit date for rebased PRs [#212](https://github.com/intuit/auto-release/pull/212) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### Authors: 1 | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
--- | ||
# v2.5.6 (Fri Jan 18 2019) | ||
@@ -2,0 +14,0 @@ |
@@ -22,2 +22,3 @@ import GHub from '@octokit/rest'; | ||
getLatestRelease(): Promise<string>; | ||
getCommitDate(sha: string): Promise<string>; | ||
getFirstCommit(): Promise<string>; | ||
@@ -24,0 +25,0 @@ getSha(): Promise<string>; |
@@ -67,2 +67,18 @@ "use strict"; | ||
}; | ||
var __read = (this && this.__read) || function (o, n) { | ||
var m = typeof Symbol === "function" && o[Symbol.iterator]; | ||
if (!m) return o; | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); | ||
} | ||
catch (error) { e = { error: error }; } | ||
finally { | ||
try { | ||
if (r && !r.done && (m = i["return"])) m.call(i); | ||
} | ||
finally { if (e) throw e.error; } | ||
} | ||
return ar; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -174,2 +190,16 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
GitHub.prototype.getCommitDate = function (sha) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var date, _a, day, time, timezone; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, exec_promise_1.default('git', ['show', '-s', '--format=%ci', sha])]; | ||
case 1: | ||
date = _b.sent(); | ||
_a = __read(date.split(' '), 3), day = _a[0], time = _a[1], timezone = _a[2]; | ||
return [2 /*return*/, day + "T" + time + timezone]; | ||
} | ||
}); | ||
}); | ||
}; | ||
GitHub.prototype.getFirstCommit = function () { | ||
@@ -176,0 +206,0 @@ return __awaiter(this, void 0, void 0, function () { |
@@ -503,9 +503,24 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var lastRelease, prsSinceLastRelease, pullRequests; | ||
var lastRelease, error_1, firstCommit, _a, prsSinceLastRelease, pullRequests; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.github.getLatestReleaseInfo()]; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_b.trys.push([0, 2, , 5]); | ||
return [4 /*yield*/, this.github.getLatestReleaseInfo()]; | ||
case 1: | ||
lastRelease = _a.sent(); | ||
lastRelease = _b.sent(); | ||
return [3 /*break*/, 5]; | ||
case 2: | ||
error_1 = _b.sent(); | ||
return [4 /*yield*/, this.github.getFirstCommit()]; | ||
case 3: | ||
firstCommit = _b.sent(); | ||
_a = {}; | ||
return [4 /*yield*/, this.github.getCommitDate(firstCommit)]; | ||
case 4: | ||
lastRelease = (_a.published_at = _b.sent(), | ||
_a); | ||
return [3 /*break*/, 5]; | ||
case 5: | ||
if (!lastRelease || !lastRelease.published_at) { | ||
@@ -517,9 +532,9 @@ return [2 /*return*/, commits]; | ||
})]; | ||
case 2: | ||
prsSinceLastRelease = _a.sent(); | ||
case 6: | ||
prsSinceLastRelease = _b.sent(); | ||
return [4 /*yield*/, Promise.all(prsSinceLastRelease.items.map(function (pr) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { | ||
return [2 /*return*/, this.github.getPullRequest(Number(pr.number))]; | ||
}); }); }))]; | ||
case 3: | ||
pullRequests = _a.sent(); | ||
case 7: | ||
pullRequests = _b.sent(); | ||
return [4 /*yield*/, Promise.all(commits.map(function (commit) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -538,4 +553,4 @@ var matchPr; | ||
}); }))]; | ||
case 4: | ||
_a.sent(); | ||
case 8: | ||
_b.sent(); | ||
return [2 /*return*/, commits]; | ||
@@ -542,0 +557,0 @@ } |
{ | ||
"name": "auto-release-cli", | ||
"description": "CLI tools to help facilitate semantic versioning based on GitHub PR labels", | ||
"version": "2.5.6", | ||
"version": "2.5.7", | ||
"main": "dist/main.js", | ||
@@ -6,0 +6,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
359923
4637