Skip to content

Commit 54484bd

Browse files
committed
fix: handle GitHub App private key in vercel
1 parent 640625d commit 54484bd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.env-example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
NEXT_PUBLIC_GTM_ID=
22
LLMS_BASE_URL=
33
GITHUB_APP_ID=
4-
GITHUB_APP_PRIVATE_KEY=
4+
GITHUB_APP_PRIVATE_KEY= # Base64 encoded GitHub App private key
55
GITHUB_APP_INSTALLATION_ID=
66
GITHUB_DISCUSSION_CATEGORY_ID=
77
GITHUB_REPOSITORY=

lib/github-discussions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
import { App } from '@octokit/app';
22
import { graphql } from '@octokit/graphql';
33

4+
// Decode base64 private key for Vercel deployment
5+
const privateKey = Buffer.from(process.env.GITHUB_APP_PRIVATE_KEY!, 'base64').toString('utf-8');
6+
47
const app = new App({
58
appId: process.env.GITHUB_APP_ID!,
6-
privateKey: process.env.GITHUB_APP_PRIVATE_KEY!,
9+
privateKey: privateKey,
710
});
811

912
async function getGraphQLClient() {

0 commit comments

Comments
 (0)