You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- name: 'Validate against local schema'env:
GLOB_PATTERN: ${{ inputs.pattern }}XSD_FILE: ${{ inputs.xsd-file }}shell: bashrun: xmllint --noout --schema "$XSD_FILE" $GLOB_PATTERN
The action never enables globstar, and GitHub Actions runs shell: bash as bash --noprofile --norc -eo pipefail, where globstar is off by default.
As a result ** collapses to a single * and only matches one path segment.
So pattern: '**/my-xml-file.xml' behaves like */my-xml-file.xml and
matches only files exactly one directory deep — there is currently no way to
validate all files with a given name regardless of depth.
Describe the solution you'd like
Enable recursive globbing before expanding $GLOB_PATTERN, e.g. add shopt -s globstar to the validation (and List files) steps.
Should be flagged / validated (all of them): my-xml-file.xml, first-dir/xml/my-xml-file.xml, second-dir/nested-dir/my-xml-file.xml
Currently matched (bug): none of the two-level-deep files; only a
hypothetical */my-xml-file.xml at exactly one level.
It would also help to set nullglob (or failglob) so a pattern that matches
nothing produces a clear message instead of passing the literal, unexpanded
pattern string to xmllint as a filename.
Additional context (optional)
Affected steps in action.yml: List files, Validate for well-formedness, Validate against local schema, Validate against downloaded remote schema.
Docs currently advertise glob support ("path/to/*/docs/*.xml") but do not
state that recursive ** is unsupported, which is surprising.
I intend to create a pull request to implement this feature.
Or at least I would let run an AI agent and see if produces an acceptable solution + test.
Is your feature request related to a problem?
The
patterninput cannot match a specific filename at an arbitrary directorydepth (e.g.
**/my-xml-file.xml).The validate steps expand the pattern via unquoted bash pathname expansion:
action.yml#L180-L186:
The action never enables
globstar, and GitHub Actions runsshell: bashasbash --noprofile --norc -eo pipefail, whereglobstaris off by default.As a result
**collapses to a single*and only matches one path segment.So
pattern: '**/my-xml-file.xml'behaves like*/my-xml-file.xmlandmatches only files exactly one directory deep — there is currently no way to
validate all files with a given name regardless of depth.
Describe the solution you'd like
Enable recursive globbing before expanding
$GLOB_PATTERN, e.g. addshopt -s globstarto the validation (andList files) steps.Given this tree:
. ├── my-xml-file.xml ├── first-dir │ └── my-xml-file.xml └── second-dir └── nested-dir └── my-xml-file.xmlWith
pattern: '**/my-xml-file.xml':my-xml-file.xml,first-dir/xml/my-xml-file.xml,second-dir/nested-dir/my-xml-file.xmlhypothetical
*/my-xml-file.xmlat exactly one level.It would also help to set
nullglob(orfailglob) so a pattern that matchesnothing produces a clear message instead of passing the literal, unexpanded
pattern string to
xmllintas a filename.Additional context (optional)
Affected steps in
action.yml:List files,Validate for well-formedness,Validate against local schema,Validate against downloaded remote schema.Docs currently advertise glob support (
"path/to/*/docs/*.xml") but do notstate that recursive
**is unsupported, which is surprising.I intend to create a pull request to implement this feature.
Or at least I would let run an AI agent and see if produces an acceptable solution + test.