feat: add read-only GitHub App access alongside OAuth

This commit is contained in:
Thomas Durieux committed 2026-09-09 22:08:12 +02:00
1 parent e5c44845f0
commit a60ad6a921
49 files changed
+1754 -139

No files matched your search

+2
View File
@@ -1,3 +1,4 @@
import { boundAppToken } from "./github-app";
import { getCredentialToken } from "./credentials";
import { RepositoryStatus } from "./types";
import User from "./User";
@@ -25,6 +26,7 @@ export default class PullRequest {
}
async getToken() {
if (this._model.githubAccess?.kind === "github-app") return boundAppToken(this.owner.id, this._model.githubAccess);
return (await getCredentialToken(this.owner.id, "github", { collection: "anonymizedpullrequests", id: this._model._id })) || config.GITHUB_TOKEN;
}