Skip to content

Commit

Permalink
(PE-39224) Adding random console password for forked pr workflow
Browse files Browse the repository at this point in the history
CI jobs triggered from forked branches aren't able to access secrets.
In this case we are using a randomised password.
  • Loading branch information
ragingra committed Sep 5, 2024
1 parent a224836 commit 8bca211
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions spec/acceptance/peadm_spec/plans/install_test_cluster.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Boolean $permit_unsafe_versions = false,
Enum['enable', 'disable'] $fips = 'disable',
String[1] $console_password

) {
$t = get_targets('*')
wait_until_available($t)
Expand All @@ -26,8 +25,17 @@
}
}

# CI jobs triggered from forks don't have access to secrets, so use randomized input instead
if $console_password == '' {
$cp = run_command(
'LC_ALL=C tr -dc \'A-Za-z0-9!"#$%&\'\\\'\'()*+,-./:;<=>?@[\]^_`{|}~\' </dev/urandom | head -c 20; echo', localhost
).first['stdout'].chomp
} else {
$cp = $console_password
}

$common_params = {
console_password => $console_password,
console_password => $cp,
download_mode => $download_mode,
code_manager_auto_configure => $code_manager_auto_configure,
version => $version,
Expand Down

0 comments on commit 8bca211

Please sign in to comment.