From e6e598fc1368a6ff1ed080ece38d0a67109a8ff5 Mon Sep 17 00:00:00 2001 From: Trenton Dyck Date: Wed, 10 Dec 2025 14:04:55 -0800 Subject: [PATCH 1/2] fix: allow wildcard regex expansion --- actions_includes/expressions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/actions_includes/expressions.py b/actions_includes/expressions.py index a915cf7..4fd8df7 100644 --- a/actions_includes/expressions.py +++ b/actions_includes/expressions.py @@ -90,10 +90,10 @@ def to_literal(v): HEX = re.compile('^0x[0-9a-fA-F]+$') EXP = re.compile('^(-?[0-9]+\\.\\[0-9]+)-?[eE]([0-9.]+)$') VALUE = re.compile('^[a-zA-Z][_a-zA-Z0-9\\-]*$') -LOOKUP = re.compile('(?:\\.[a-zA-Z][_a-zA-Z0-9\\-]*)|(?:\\[[^\\]]+\\])') +LOOKUP = re.compile('(?:\\.(?:[a-zA-Z][_a-zA-Z0-9\\-]*|\\*))|(?:\\[[^\\]]+\\])') S = "('[^']*')+" -I = "[a-zA-Z.\\-0-9_\\[\\]]+" +I = "[a-zA-Z.\\-0-9_\\[\\]*]+" BITS = re.compile('((?P{})|(?P{}))'.format(S, I)) From e15475765b74b07d6926e9250f3520fb194786bb Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Thu, 11 Dec 2025 20:57:50 +1030 Subject: [PATCH 2/2] test: add doctests for wildcard expression parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add doctests to verify the wildcard regex expansion fix works correctly: - from_literal("needs.*.result") -> Lookup('needs', '*', 'result') - tokenizer("contains(needs.*.result, 'failure')") parses correctly 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- actions_includes/expressions.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/actions_includes/expressions.py b/actions_includes/expressions.py index 4fd8df7..c9bc50f 100644 --- a/actions_includes/expressions.py +++ b/actions_includes/expressions.py @@ -188,6 +188,9 @@ def tokenizer(s): >>> p(tokenizer("manylinux-versions[inputs.python-version]")) Lookup('manylinux-versions', Lookup('inputs', 'python-version')) + >>> p(tokenizer("contains(needs.*.result, 'failure')")) + (, Lookup('needs', '*', 'result'), 'failure') + >>> p(tokenizer('success()')) (,) @@ -1164,6 +1167,8 @@ def from_literal(v): Lookup('a', Lookup('b', 'c')) >>> from_literal("a.b.c") Lookup('a', 'b', 'c') + >>> from_literal("needs.*.result") + Lookup('needs', '*', 'result') >>> from_literal("a[b].c") Lookup('a', Value(b), 'c') >>> from_literal("a[b][c]")