Skip to content

Commit 9a68b93

Browse files
fix(ci): repair yaml-path validation regex in _update-helm (#11)
The regex was '^\.[a-zA-Z0-9_.\[\]\"'\''-]+$' (single quote inside the character class). Bash sees the lone ' as the start of a quoted string, never finds a matching close, and aborts the script: /home/runner/.../11c37765-eb1d-4999-8298-6e83176c2ab2.sh: line 8: unexpected EOF while looking for matching `'' Process completed with exit code 2. Bug surfaced on release run 25112483893 — the first time Update Helm actually executed end-to-end. Earlier runs either OOMed or used a manual helm-charts PR (blockscout#177) so the broken script never ran. Two issues, one fix: 1. Drop the lone single quote from the class. yq paths we use (.frontend.image.tag, .image.tag) never contain single quotes; stripping the apostrophe is safe. 2. Use the POSIX bracket-expression idiom for including literal square brackets: ']' must come first inside [], '[' anywhere else. The form '\[\]' worked in some regex flavors but breaks bash's =~ pattern matching. Verified locally that the new form '^\.[][a-zA-Z0-9_.-]+$' accepts .frontend.image.tag, .image.tag, .foo[0].bar, and rejects the obvious injection shapes (semicolons, dollar signs, spaces, backticks, pipes).
1 parent 201942e commit 9a68b93

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/_update-helm.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,12 @@ jobs:
124124
exit 1
125125
fi
126126
127-
# Validate yaml path: must start with '.' and contain only letters, digits, dots, underscores, hyphens, brackets, quotes
128-
if ! [[ "$YAML_PATH" =~ ^\.[a-zA-Z0-9_.\[\]\"'-]+$ ]]; then
127+
# Validate yaml path: must start with a dot and contain only letters,
128+
# digits, dots, underscores, hyphens, and brackets. POSIX bracket-class
129+
# form requires ']' first and '[' later to be treated as literals
130+
# ('^\.[][a-zA-Z0-9_.-]+$'); a lone single-quote in the class would
131+
# break the bash lexer.
132+
if ! [[ "$YAML_PATH" =~ ^\.[][a-zA-Z0-9_.-]+$ ]]; then
129133
echo "❌ Invalid yaml path: $YAML_PATH"
130134
exit 1
131135
fi

0 commit comments

Comments
 (0)