Skip to content

Commit

Permalink
Use apg to generate passwords
Browse files Browse the repository at this point in the history
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 <gsamfira@cloudbasesolutions.com>
  • Loading branch information
gabriel-samfira committed Aug 22, 2023
1 parent aa2b42f commit e1efcd1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ jobs:

- name: Generate secrets
run: |
function randomStringGenerator() {
tr -dc "a-zA-Z0-9@#$%^&*()_+?><~\`;'" </dev/urandom | 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"
Expand Down

0 comments on commit e1efcd1

Please sign in to comment.