GitHub bot: fix linting issues (nobuild)

This commit is contained in:
github-actions
2025-07-08 09:04:46 +00:00
parent f183d6bc75
commit 54e7b890e6

View File

@@ -29,18 +29,18 @@ mapfile -t arr < <(jq -r 'keys[]' "${JSONSOURCE}")
# Escape special characters using printf and enclose in double quotes # Escape special characters using printf and enclose in double quotes
sanitize_variable() { sanitize_variable() {
local raw="$1" # original value local raw="$1" # original value
local escaped # value after printf %q local escaped # value after printf %q
printf -v escaped '%q' "$raw" printf -v escaped '%q' "$raw"
# If nothing changed, return the original. # If nothing changed, return the original.
[[ "$raw" == "$escaped" ]] && { [[ "$raw" == "$escaped" ]] && {
printf '%s' "$raw" printf '%s' "$raw"
return return
} }
# Otherwise protect the escaped string with double quotes. # Otherwise protect the escaped string with double quotes.
printf '"%s"' "$escaped" printf '"%s"' "$escaped"
} }
for KEYS in "${arr[@]}"; do for KEYS in "${arr[@]}"; do
@@ -51,8 +51,8 @@ for KEYS in "${arr[@]}"; do
bashio::log.warning "One of your option is an array, skipping" bashio::log.warning "One of your option is an array, skipping"
else else
# Sanitize variable # Sanitize variable
VALUE=$(sanitize_variable "$VALUE") VALUE=$(sanitize_variable "$VALUE")
# Continue for single values # Continue for single values
line="${KEYS}=${VALUE}" line="${KEYS}=${VALUE}"
# Check if secret # Check if secret