Foramt privatekey

This commit is contained in:
x032205
2025-08-25 18:26:34 -04:00
parent f63ee39f3d
commit a349dda4bc
@@ -119,7 +119,7 @@ export const getGitHubAppAuthToken = async (
) => { ) => {
const appCfg = getConfig(); const appCfg = getConfig();
const appId = appCfg.INF_APP_CONNECTION_GITHUB_APP_ID; const appId = appCfg.INF_APP_CONNECTION_GITHUB_APP_ID;
const appPrivateKey = appCfg.INF_APP_CONNECTION_GITHUB_APP_PRIVATE_KEY; let appPrivateKey = appCfg.INF_APP_CONNECTION_GITHUB_APP_PRIVATE_KEY;
if (!appId || !appPrivateKey) { if (!appId || !appPrivateKey) {
throw new InternalServerError({ throw new InternalServerError({
@@ -127,6 +127,11 @@ export const getGitHubAppAuthToken = async (
}); });
} }
appPrivateKey = appPrivateKey
.split("\n")
.map((line) => line.trim())
.join("\n");
if (appConnection.method !== GitHubConnectionMethod.App) { if (appConnection.method !== GitHubConnectionMethod.App) {
throw new InternalServerError({ message: "Cannot generate GitHub App token for non-app connection" }); throw new InternalServerError({ message: "Cannot generate GitHub App token for non-app connection" });
} }