diff --git a/ci-automation/ci_automation_common.sh b/ci-automation/ci_automation_common.sh index d1db1aa8f6..488b4d6a1c 100644 --- a/ci-automation/ci_automation_common.sh +++ b/ci-automation/ci_automation_common.sh @@ -310,7 +310,8 @@ function secret_to_file() { exec {fd}<>"${tmpfile}" rm -f "${tmpfile}" echo "${secret}" | base64 --decode >&${fd} - config_ref="/proc/${$}/fd/${fd}" + # Use BASHPID because we may be in a subshell but $$ is only the main shell's PID + config_ref="/proc/${BASHPID}/fd/${fd}" } # --