diff --git a/.changeset/flat-camels-scream.md b/.changeset/flat-camels-scream.md new file mode 100644 index 0000000000..2c49af5010 --- /dev/null +++ b/.changeset/flat-camels-scream.md @@ -0,0 +1,5 @@ +--- +'@backstage/integration': patch +--- + +By replacing `\n` with a newline for GitHub Apps private keys, this allows users to store the private key as an environment variable and reference it in the YAML. diff --git a/packages/integration/src/github/GithubCredentialsProvider.ts b/packages/integration/src/github/GithubCredentialsProvider.ts index 7e6057fc8d..278a1ed028 100644 --- a/packages/integration/src/github/GithubCredentialsProvider.ts +++ b/packages/integration/src/github/GithubCredentialsProvider.ts @@ -74,7 +74,7 @@ class GithubAppManager { this.baseUrl = baseUrl; this.baseAuthConfig = { appId: config.appId, - privateKey: config.privateKey, + privateKey: config.privateKey.replace(/\\n/gm, '\n'), }; this.appClient = new Octokit({ baseUrl,