Fix misleading error when _FILE secret is not readable.

pull/9637/head
kon-foo 2026-02-18 07:40:23 +01:00 committed by GitHub
parent 50f78bf210
commit b15f15960f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,10 @@ function file_env() {
local val="$def"
if [ "${!var:-}" ]; then
val="${!var}"
elif [ "${!fileVar:-}" ] && [ ! -r "${!fileVar}" ]; then
printf >&2 'error: %s is set to "%s" but the file does not exist or is not readable\n' \
"$fileVar" "${!fileVar}"
exit 1
elif [ "${!fileVar:-}" ]; then
val="$(< "${!fileVar}")"
fi