Merge pull request #79 from RoseSecurity/fix-bash-incompatibility-errors

fix(hooks): Make env var regex portable
This commit is contained in:
kvendingoldo 2026-06-13 01:59:48 +04:00 committed by GitHub
commit cc0381b3f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -112,7 +112,7 @@ function common::parse_and_export_env_vars {
while true; do
# Check if at least 1 env var exists in `$arg`
# shellcheck disable=SC2016 # '${' should not be expanded
if [[ "$arg" =~ .*'${'[A-Z_][A-Z0-9_]*'}'.* ]]; then
if [[ "$arg" =~ '${'[A-Z_][A-Za-z0-9_]*'}' ]]; then
# Get `ENV_VAR` from `.*${ENV_VAR}.*`
local env_var_name=${arg#*$\{}
env_var_name=${env_var_name%%\}*}