mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-03-03 03:13:19 +00:00
fix: get files for new repos
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import { Branch } from "../types";
|
||||
import * as gh from "parse-github-url";
|
||||
import { IRepositoryDocument } from "../database/repositories/repositories.types";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { Octokit, RestEndpointMethodTypes } from "@octokit/rest";
|
||||
import RepositoryModel from "../database/repositories/repositories.model";
|
||||
import AnonymousError from "../AnonymousError";
|
||||
|
||||
export class GitHubRepository {
|
||||
private _data: Partial<
|
||||
{ [P in keyof IRepositoryDocument]: IRepositoryDocument[P] }
|
||||
>;
|
||||
private _data: Partial<{
|
||||
[P in keyof IRepositoryDocument]: IRepositoryDocument[P];
|
||||
}>;
|
||||
constructor(
|
||||
data: Partial<{ [P in keyof IRepositoryDocument]: IRepositoryDocument[P] }>
|
||||
) {
|
||||
@@ -167,7 +167,7 @@ export async function getRepositoryFromGitHub(opt: {
|
||||
opt.repo = opt.repo.replace(".git", "");
|
||||
}
|
||||
const octokit = new Octokit({ auth: opt.accessToken });
|
||||
let r;
|
||||
let r: RestEndpointMethodTypes["repos"]["get"]["response"]["data"];
|
||||
try {
|
||||
r = (
|
||||
await octokit.repos.get({
|
||||
|
||||
Reference in New Issue
Block a user