feat(aio): verify uploaded builds based on JWT from Travis

This commit is contained in:
Georgios Kalpakas
2017-02-28 21:10:46 +02:00
committed by Chuck Jazdzewski
parent 028b274750
commit 2796790c7d
6 changed files with 262 additions and 90 deletions

View File

@ -3,8 +3,9 @@ import {assertNotMissingOrEmpty} from '../common/utils';
import {GithubApi} from './github-api';
// Interfaces - Types
interface PullRequest {
export interface PullRequest {
number: number;
user: {login: string};
}
export type PullRequestState = 'all' | 'closed' | 'open';
@ -28,6 +29,10 @@ export class GithubPullRequests extends GithubApi {
return this.post<void>(`/repos/${this.repoSlug}/issues/${pr}/comments`, null, {body});
}
public fetch(pr: number): Promise<PullRequest> {
return this.get<PullRequest>(`/repos/${this.repoSlug}/pulls/${pr}`);
}
public fetchAll(state: PullRequestState = 'all'): Promise<PullRequest[]> {
console.log(`Fetching ${state} pull requests...`);