From d17e66593eb6509065fa0857c2a6c705901b7f84 Mon Sep 17 00:00:00 2001 From: ThrRip Date: Wed, 8 Nov 2023 09:57:24 +0800 Subject: [PATCH] Fix incomplete environment variable replacement in CI/CD --- .github/workflows/build-deploy.yml | 5 ++++- .idea/dictionaries/thrrip.xml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index d4dc8cc..634caa8 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -50,6 +50,7 @@ jobs: - name: Replace environment variables run: | [ -z "${{ secrets[format('PROD_{0}_PM2_CONF_ENV', inputs.package_cap)] }}" ] || ( + temp=$(mktemp) echo "${{ secrets[format('PROD_{0}_PM2_CONF_ENV', inputs.package_cap)] }}" | awk ' /env: {/,/}/ { @@ -58,7 +59,9 @@ jobs: next } { print } - ' packages/${{ inputs.package }}/ecosystem.config.js + ' packages/${{ inputs.package }}/ecosystem.config.js > "$temp" + cp --no-preserve=all "$temp" packages/${{ inputs.package }}/ecosystem.config.js + rm -f "$temp" ) - name: Package the build run: | diff --git a/.idea/dictionaries/thrrip.xml b/.idea/dictionaries/thrrip.xml index 9cd599a..d4ee202 100644 --- a/.idea/dictionaries/thrrip.xml +++ b/.idea/dictionaries/thrrip.xml @@ -7,6 +7,7 @@ dscreen fortawesome getline + mktemp nuxtjs shopt webmanifest