diff --git a/packages/shared/src/github/auth.ts b/packages/shared/src/github/auth.ts index 6c90812e..97be1ddb 100644 --- a/packages/shared/src/github/auth.ts +++ b/packages/shared/src/github/auth.ts @@ -1,7 +1,7 @@ import { generateJWT } from "../jwt.js"; -const replaceNewlinesWithBackslashN = (str: string) => - str.replace(/\n/g, "\\n"); +const convertEscapedNewlinesToNewlines = (str: string) => + str.replace(/\\n/g, "\n"); /** * Gets an installation access token for a GitHub App installation @@ -13,7 +13,7 @@ export async function getInstallationToken( ): Promise { const jwtToken = generateJWT( appId, - replaceNewlinesWithBackslashN(privateKey), + convertEscapedNewlinesToNewlines(privateKey), ); const response = await fetch(