Wire GitHub App auth through workflows
This commit is contained in:
1 parent
9a0a0cdf45
commit
8505a5b4fc
5 files changed
+61
-4
No files matched your search
+1
-1
@@ -28,7 +28,7 @@ const envBoolean = z.preprocess((value) => {
|
||||
|
||||
const configSchema = z.object({
|
||||
port: z.coerce.number().int().positive().default(3000),
|
||||
githubToken: z.string().min(1),
|
||||
githubToken: optionalString,
|
||||
githubAppId: optionalString,
|
||||
githubAppPrivateKey: optionalString,
|
||||
githubAppInstallationId: z.preprocess((value) => {
|
||||
|
||||
@@ -45,6 +45,12 @@ export async function createGitHubClient(params?: {
|
||||
}
|
||||
}
|
||||
|
||||
if (!config.githubToken) {
|
||||
throw new Error(
|
||||
"GitHub authentication is not configured. Provide GITHUB_TOKEN, or set GITHUB_APP_ID and GITHUB_APP_PRIVATE_KEY."
|
||||
);
|
||||
}
|
||||
|
||||
return new Octokit({
|
||||
auth: config.githubToken
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user