auto-release-cli
Advanced tools
Comparing version 0.20.13 to 0.20.14
114
CHANGELOG.md
@@ -0,1 +1,115 @@ | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.14 (Wed Dec 05 2018) | ||
--- | ||
# v0.20.13 (Wed Dec 05 2018) | ||
@@ -2,0 +116,0 @@ |
@@ -24,3 +24,2 @@ import GHub from '@octokit/rest'; | ||
private readonly logger; | ||
private hasAuthed; | ||
constructor(options: IGithubOptions); | ||
@@ -27,0 +26,0 @@ authenticate(authToken?: string): Promise<void>; |
@@ -26,2 +26,8 @@ "use strict"; | ||
}; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -88,2 +94,3 @@ return new (P || (P = Promise))(function (resolve, reject) { | ||
var parse_git_1 = require("parse-git"); | ||
var typescript_memoize_1 = require("typescript-memoize"); | ||
var exec_promise_1 = __importDefault(require("./utils/exec-promise")); | ||
@@ -105,3 +112,2 @@ var GithubAPIError = /** @class */ (function (_super) { | ||
this.options.baseUrl = this.options.baseUrl || 'https://api.github.com'; | ||
this.hasAuthed = false; | ||
this.logger.veryVerbose.info("Initializing Github with: " + this.options.baseUrl); | ||
@@ -116,5 +122,2 @@ this.ghub = new rest_1.default({ | ||
return __generator(this, function (_a) { | ||
if (this.hasAuthed) { | ||
return [2 /*return*/]; | ||
} | ||
if (authToken === undefined && this.options.token === undefined) { | ||
@@ -129,3 +132,2 @@ throw new Error('Auth needs a Github token.'); | ||
}); | ||
this.hasAuthed = true; | ||
this.logger.veryVerbose.info('Sucessfully authenticated with Github.'); | ||
@@ -470,2 +472,8 @@ return [2 /*return*/, Promise.resolve()]; | ||
}; | ||
__decorate([ | ||
typescript_memoize_1.Memoize() | ||
], Github.prototype, "authenticate", null); | ||
__decorate([ | ||
typescript_memoize_1.Memoize() | ||
], Github.prototype, "getUserByEmail", null); | ||
return Github; | ||
@@ -472,0 +480,0 @@ }()); |
@@ -216,2 +216,3 @@ "use strict"; | ||
var client, gitlog, commits; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
@@ -231,31 +232,40 @@ switch (_a.label) { | ||
this.logger.veryVerbose.info('Added labels to commits:\n', commits); | ||
// await Promise.all( | ||
// commits.map(async commit => { | ||
// let resolvedAuthors = []; | ||
// console.log('here'); | ||
// if (commit.pullRequest) { | ||
// const prCommits = await client.getCommitsForPR( | ||
// Number(commit.pullRequest.number) | ||
// ); | ||
// if (!prCommits) { | ||
// return; | ||
// } | ||
// resolvedAuthors = await Promise.all( | ||
// prCommits.map(async prCommit => | ||
// client.getUserByUsername(prCommit.author.login) | ||
// ) | ||
// ); | ||
// } else if (commit.author.email) { | ||
// const author = await client.getUserByEmail(commit.author.email); | ||
// resolvedAuthors.push(author); | ||
// } | ||
// commit.authors = resolvedAuthors.map(author => ({ | ||
// ...author, | ||
// username: author ? author.login : undefined | ||
// })); | ||
// commit.authors.map(author => { | ||
// this.logger.veryVerbose.info(`Found author: ${author.username}`); | ||
// }); | ||
// }) | ||
// ); | ||
return [4 /*yield*/, Promise.all(commits.map(function (commit) { return __awaiter(_this, void 0, void 0, function () { | ||
var resolvedAuthors, prCommits, author; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
resolvedAuthors = []; | ||
if (!commit.pullRequest) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, client.getCommitsForPR(Number(commit.pullRequest.number))]; | ||
case 1: | ||
prCommits = _a.sent(); | ||
if (!prCommits) { | ||
return [2 /*return*/]; | ||
} | ||
return [4 /*yield*/, Promise.all(prCommits.map(function (prCommit) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { | ||
return [2 /*return*/, client.getUserByUsername(prCommit.author.login)]; | ||
}); }); }))]; | ||
case 2: | ||
resolvedAuthors = _a.sent(); | ||
return [3 /*break*/, 5]; | ||
case 3: | ||
if (!commit.author.email) return [3 /*break*/, 5]; | ||
return [4 /*yield*/, client.getUserByEmail(commit.author.email)]; | ||
case 4: | ||
author = _a.sent(); | ||
resolvedAuthors.push(author); | ||
_a.label = 5; | ||
case 5: | ||
commit.authors = resolvedAuthors.map(function (author) { return (__assign({}, author, { username: author ? author.login : undefined })); }); | ||
commit.authors.map(function (author) { | ||
_this.logger.veryVerbose.info("Found author: " + author.username); | ||
}); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }))]; | ||
case 4: | ||
_a.sent(); | ||
return [2 /*return*/, commits]; | ||
@@ -262,0 +272,0 @@ } |
{ | ||
"name": "auto-release-cli", | ||
"description": "CLI tools to help facilitate semantic versioning based on Github PR labels.", | ||
"version": "0.20.13", | ||
"version": "0.20.14", | ||
"author": "Intuit", | ||
@@ -61,2 +61,3 @@ "license": "MIT", | ||
"typescript": "~3.2.1", | ||
"typescript-memoize": "^1.0.0-alpha.3", | ||
"typescript-tslint-plugin": "^0.1.2" | ||
@@ -63,0 +64,0 @@ }, |
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
186842
2459
14