From dd9cf64dd5e28264a1f1484f2fe17e69268c1cad Mon Sep 17 00:00:00 2001 From: Connor Younglund Date: Wed, 13 Oct 2021 13:10:15 -0400 Subject: [PATCH 1/2] replace `\n` with newline for GitHub App private key Signed-off-by: Connor Younglund --- packages/integration/src/github/GithubCredentialsProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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, From eab072161e36cd0a8457212f8d1f21e3671894e6 Mon Sep 17 00:00:00 2001 From: Connor Younglund Date: Wed, 13 Oct 2021 13:30:09 -0400 Subject: [PATCH 2/2] generate changeset Signed-off-by: Connor Younglund --- .changeset/flat-camels-scream.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/flat-camels-scream.md 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.