Skip to content

Commit 9ad7c49

Browse files
committed
fix(workflow): update params.json creation and redaction
- Simplified the creation of `params.json` using `echo`. - Redacted `console_password` in `params.json` using `sed` for security.
1 parent bf023c3 commit 9ad7c49

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

.github/workflows/test-convert-to-legacy.yaml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,17 +225,12 @@ jobs:
225225
primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml)
226226
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
227227
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2)
228-
jq -n --arg primary_host "$primary" \
229-
--argjson legacy_compilers '[$legacy_compiler]' \
230-
--argjson compiler_hosts '[$compiler]' \
231-
--arg version "2023.8.0" \
232-
--arg console_password "${{ secrets.CONSOLE_PASSWORD }}" \
233-
'{primary_host: $primary_host, legacy_compilers: $legacy_compilers, compiler_hosts: $compiler_hosts, version: $version, console_password: $console_password}' > params.json
228+
echo -n '{ "primary_host": "'$primary'", "legacy_compilers": ["'$legacy_compiler'"], "compiler_hosts": ["'$compiler'"], "version": "2023.8.0", "console_password": "'${{ secrets.CONSOLE_PASSWORD }}'" }' > params.json
234229
- name: Install PE with legacy compilers
235230
timeout-minutes: 120
236231
run: |
237232
echo ::group::params.json
238-
cat params.json
233+
sed -e 's/console_password: .*/console_password: "[redacted]"/' < params.json || true
239234
echo ::endgroup::
240235
echo ::group::install
241236
bundle exec bolt plan run peadm::install \

0 commit comments

Comments
 (0)