Skip to content

Commit

Permalink
feat(workflow): add random hash generation for console password in te…
Browse files Browse the repository at this point in the history
…st-legacy-upgrade

- Added a step to generate a random hash for the console password using /dev/urandom.
- Updated the params.json creation to use the generated hash instead of a fixed secret.
- Ensured the hash is printed for debugging purposes.
  • Loading branch information
CoMfUcIoS committed Oct 9, 2024
1 parent 9a9703e commit 89547a8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/test-legacy-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Upgrade PE with legacy compilers
on:
push:
pull_request:
paths:
- .github/workflows/**/*
Expand Down Expand Up @@ -97,7 +98,9 @@ jobs:
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p)
replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml)
echo -n '{ "download_mode": "direct", "primary_host": "'$primary'", "replica_host": "'$replica'", "legacy_compilers": ["'$legacy_compiler'"], "compiler_hosts": ["'$compiler'"], "version": "2023.7.0", "console_password": "'${{ secrets.CONSOLE_PASSWORD }}'" }' > params.json
hash_random=$(LC_ALL=C tr -dc \'A-Za-z0-9!"#$%&\'\\\'\'()*+,-./:;<=>?@[\]^_`{|}~\' </dev/urandom | head -c 30; echo)
echo $hash_random
echo -n '{ "download_mode": "direct", "primary_host": "'$primary'", "replica_host": "'$replica'", "legacy_compilers": ["'$legacy_compiler'"], "compiler_hosts": ["'$compiler'"], "version": "2023.7.0", "console_password": "'$hash_random'" }' > params.json
- name: Install PE with legacy compilers
timeout-minutes: 120
run: |
Expand Down

0 comments on commit 89547a8

Please sign in to comment.