From 6e98c3e08884be61bc9fcb1383d3d7d3e2f0ee42 Mon Sep 17 00:00:00 2001 From: Gabriel Adrian Samfira Date: Tue, 22 Aug 2023 19:28:59 +0000 Subject: [PATCH] Use apg to generate passwords It appears that in some cases, generating passwords by reading /dev/urandom and piping to tr, fails. Use apg. Signed-off-by: Gabriel Adrian Samfira --- .github/workflows/integration-tests.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 18d155a7..7f1f8491 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -30,13 +30,11 @@ jobs: - name: Generate secrets run: | - function randomStringGenerator() { - tr -dc "a-zA-Z0-9@#%^&*()_+?><~;" /dev/null | head -c 64 ; echo ''; - } + sudo apt-get -qq update && sudo apt-get -qq install -y apg - GARM_PASSWORD=$(randomStringGenerator) - REPO_WEBHOOK_SECRET=$(randomStringGenerator) - ORG_WEBHOOK_SECRET=$(randomStringGenerator) + GARM_PASSWORD=$(apg -n1 -m32) + REPO_WEBHOOK_SECRET=$(apg -n1 -m32) + ORG_WEBHOOK_SECRET=$(apg -n1 -m32) echo "::add-mask::$GARM_PASSWORD" echo "::add-mask::$REPO_WEBHOOK_SECRET"