From ee2a69b9bd48b27fa5f4572e14df24a55cc59bce Mon Sep 17 00:00:00 2001 From: Chen Yu Date: Mon, 12 Aug 2024 12:28:24 +0900 Subject: [PATCH] ci: inject environment variables from github action (#3233) Co-authored-by: homura --- .github/workflows/package.yml | 5 +++++ packages/neuron-wallet/src/services/log-encryption.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index d1d21db08c..10200e7ebb 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -103,6 +103,11 @@ jobs: env: CI: false + # Inject LOG_ENCRYPTION_PUBLIC_KEY to encrypt sensitive log + - name: Inject environment variables + run: | + echo "\nLOG_ENCRYPTION_PUBLIC_KEY=${{ secrets.LOG_ENCRYPTION_PUBLIC_KEY }}\n" >> packages/neuron-wallet/.env + - name: Package for MacOS if: matrix.os == 'macos-latest' run: | diff --git a/packages/neuron-wallet/src/services/log-encryption.ts b/packages/neuron-wallet/src/services/log-encryption.ts index b27dbcfc32..31c024d19c 100644 --- a/packages/neuron-wallet/src/services/log-encryption.ts +++ b/packages/neuron-wallet/src/services/log-encryption.ts @@ -26,7 +26,7 @@ export default class LogEncryption { * @param adminPublicKey a PEM-formatted RSA public key */ constructor(adminPublicKey: string) { - this.adminPublicKey = adminPublicKey + this.adminPublicKey = adminPublicKey.replace(/\\n/g, '\n') } /**