fix: send one access alert per repository until owner action

This commit is contained in:
Thomas Durieux committed 2026-10-09 07:38:52 +00:00
1 parent c55efd14ed
commit d519a0a9bb
19 files changed
+172 -116

No files matched your search

-9
View File
@@ -1,4 +1,3 @@
import { notifyOwnerAccessProblem } from "./owner-notifications";
import { registerGitHubToken } from "./github-token-context";
import { createSign, randomUUID } from "crypto";
import { readFileSync } from "fs";
@@ -88,14 +87,6 @@ export async function saveAppGrant(ownerId: string, data: AppTokenResponse) {
}
export async function appUserToken(ownerId: string): Promise<string> {
try { return await resolveAppUserToken(ownerId); }
catch (error) {
void notifyOwnerAccessProblem(ownerId, error);
throw error;
}
}
async function resolveAppUserToken(ownerId: string): Promise<string> {
if (!config.GITHUB_APP_ENABLED) throw appError("github_app_disabled", 503);
const user = await UserModel.findById(ownerId).select("status externalIDs").lean();
if (!user || user.status === "removed" || user.status === "banned") throw appError();