Skip to content

Commit e17f6b5

Browse files
authored
feat(workflow): add random hash generation for console password in test-legacy-upgrade (#513)
* feat(workflow): add random hash generation for console password in test-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. * fix(workflow): correct hash generation syntax in test-legacy-upgrade - Fixed the syntax for generating a random hash for the console password using /dev/urandom. - Ensured proper escaping of special characters in the tr command. * chore(workflow): remove push trigger from test-legacy-upgrade workflow - Removed the push event trigger to streamline the workflow execution. - The workflow will now only trigger on pull requests affecting .github/workflows/**/*
1 parent 9a9703e commit e17f6b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/test-legacy-upgrade.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ jobs:
9797
compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1)
9898
legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | sed -n 2p)
9999
replica=$(yq '.groups[].targets[] | select(.vars.role == "replica") | .name' spec/fixtures/litmus_inventory.yaml)
100-
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
100+
hash_random=$(LC_ALL=C tr -dc 'A-Za-z0-9!#$%&'\''()*+,-./:;<=>?@[\]^_`{|}~' </dev/urandom | head -c 30; echo)
101+
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
101102
- name: Install PE with legacy compilers
102103
timeout-minutes: 120
103104
run: |

0 commit comments

Comments
 (0)