MCPcopy Create free account
hub / github.com/pollinations/pollinations / githubAppCredentialsFromEnv

Function githubAppCredentialsFromEnv

shared/github/app-auth.ts:240–250  ·  view source on GitHub ↗
(env: {
    GITHUB_APP_ID?: string;
    GITHUB_APP_PRIVATE_KEY?: string;
})

Source from the content-addressed store, hash-verified

238
239/** Read App credentials off a Worker env. Throws if either is missing. */
240export function githubAppCredentialsFromEnv(env: {
241 GITHUB_APP_ID?: string;
242 GITHUB_APP_PRIVATE_KEY?: string;
243}): GithubAppCredentials {
244 if (!env.GITHUB_APP_ID || !env.GITHUB_APP_PRIVATE_KEY) {
245 throw new Error(
246 "missing GITHUB_APP_ID or GITHUB_APP_PRIVATE_KEY in env",
247 );
248 }
249 return { appId: env.GITHUB_APP_ID, privateKey: env.GITHUB_APP_PRIVATE_KEY };
250}
251
252/** Test-only: reset the module token/installation cache. */
253export function __resetGithubAppAuthCache(): void {

Callers 1

githubTokenFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected