js-green-licenses
Version: 
JavaScript package.json license checker
24 lines (23 loc) • 926 B
TypeScript
export interface PRCommits {
    mergeCommitSha: string;
    headCommitSha: string;
}
export type CommitStatus = 'error' | 'failure' | 'pending' | 'success';
export interface PackageJsonFile {
    filePath: string;
    content: string;
}
export declare class GitHubRepository {
    private readonly pathPrefix;
    private static MAX_PR_COMMIT_RETRIES;
    constructor(owner: string, repo: string);
    private getAxiosConfig;
    private apiGet;
    private apiPost;
    getPRCommits(prId: number, attemptCount?: number): Promise<PRCommits>;
    createPRReview(prId: number, commitSha: string, body: string): Promise<void>;
    setCommitStatus(commitSha: string, status: CommitStatus, description: string, context?: string): Promise<void>;
    getFileContent(commitSha: string, path: string): Promise<string | null>;
    private getSinglePackageJson;
    getPackageJsonFiles(commitSha: string): Promise<PackageJsonFile[]>;
}