Skip to content

fix: allow wildcard regex expansion#48

Merged
mithro merged 2 commits intomithro:mainfrom
trent-abc:main
Dec 12, 2025
Merged

fix: allow wildcard regex expansion#48
mithro merged 2 commits intomithro:mainfrom
trent-abc:main

Conversation

@trent-abc
Copy link
Contributor

Fixes an issue with wildcard conditionals. Allows the following in an action for example:

      if: "${{ contains(needs.*.result, 'failure') }}"

@mithro
Copy link
Owner

mithro commented Dec 11, 2025

I asked claude-code to add some tests based on your change. Do they look right?

@trent-abc
Copy link
Contributor Author

trent-abc commented Dec 11, 2025

I asked claude-code to add some tests based on your change. Do they look right?

Probably? The exception that I was getting seems related to your test cases

Traceback (most recent call last):
  File "/actions_includes/expressions.py", line 228, in tokenizer
    for i in split(s):
  File "/actions_includes/expressions.py", line 224, in split
    yield from_literal(m.group(0))
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/actions_includes/expressions.py", line 1208, in from_literal
    raise ValueError('Unknown literal? {!r}'.format(v))
ValueError: Unknown literal? 'needs.'

fwiw gemini 3 pro gave me the regex fix 😆

@mithro
Copy link
Owner

mithro commented Dec 12, 2025

Blind leading the blind :-P

mithro added a commit that referenced this pull request Dec 12, 2025
GitHub removed ubuntu-20.04 runners in April 2024, causing workflows
to be stuck in "queued" state indefinitely. This updates all test
workflow templates and regenerates the corresponding workflow files
to use ubuntu-latest instead.

Fixes jobs stuck pending on PR #48 and similar issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
trent-abc and others added 2 commits December 12, 2025 17:01
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 <noreply@anthropic.com>
@mithro
Copy link
Owner

mithro commented Dec 12, 2025

Well, after a few small tweaks, the GitHub Actions say yes.

@mithro
Copy link
Owner

mithro commented Dec 12, 2025

I'm going to merge this change.

@mithro mithro merged commit 304e66a into mithro:main Dec 12, 2025
40 checks passed
@mithro
Copy link
Owner

mithro commented Dec 12, 2025

@trent-abc - However, I would suggest you update whatever is using actions-include to use a better replacement like Composite Actions or Reusable workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants