Skip to content

Commit

Permalink
fix(github): use right typings for user
Browse files Browse the repository at this point in the history
  • Loading branch information
tagoro9 committed Sep 16, 2021
1 parent 8d6ad2d commit f934cf4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@oclif/command": "^1.5.19",
"@oclif/config": "^1.14.0",
"@oclif/plugin-help": "^3.1.0",
"@octokit/rest": "^18.0.3",
"@octokit/rest": "^18.10.0",
"@scarf/scarf": "^1.0.6",
"@types/env-ci": "^3.1.0",
"autobind-decorator": "^2.4.0",
Expand Down
14 changes: 12 additions & 2 deletions src/git/Github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import escapeHtml from 'escape-html';
import {
compose,
concat as rConcat,
filter,
has,
head,
join,
map,
Expand Down Expand Up @@ -226,7 +228,15 @@ export class Github implements Remote {
map<{ login: string }, string>(prop('login')),
),
)
.then(uniqBy(prop('login')));
.then(
compose(
uniqBy(prop('login')),
map<RestEndpointMethodTypes['users']['getByUsername']['response']['data'], Reviewer>(
(user) => user as Reviewer,
),
filter(has('login')),
),
);
}

/**
Expand Down Expand Up @@ -369,7 +379,7 @@ export class Github implements Remote {
private async listContributors(): Promise<Array<{ login: string }>> {
const collaborators = await this.queueCall(
() =>
this.api.repos.listContributors({
this.api.repos.listCollaborators({
owner: this.config.owner,
per_page: 100,
repo: this.config.repo,
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1306,7 +1306,7 @@
"@octokit/plugin-request-log" "^1.0.0"
"@octokit/plugin-rest-endpoint-methods" "^3.12.2"

"@octokit/rest@^18.0.3":
"@octokit/rest@^18.10.0":
version "18.10.0"
resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.10.0.tgz#8a0add9611253e0e31d3ed5b4bc941a3795a7648"
integrity sha512-esHR5OKy38bccL/sajHqZudZCvmv4yjovMJzyXlphaUo7xykmtOdILGJ3aAm0mFHmMLmPFmDMJXf39cAjNJsrw==
Expand Down

0 comments on commit f934cf4

Please sign in to comment.