dorny / paths-filter

Conditionally run actions based on files modified by PR, feature branch or pushed commits
MIT License
2.14k stars 239 forks source link

[FR] Regex capture groups in filters #153

Open ChipWolf opened 2 years ago

ChipWolf commented 2 years ago

It'd be useful to define a regex substitution, for example to capture all top-level directories:

Instead of:

with:
  filters: |
    foo:
      - 'foo/**'
    bar:
      - 'bar/**'
    baz:
      - 'baz/**'

This would achieve the same thing, with less maintenance:

with:
  regex: true
  filters: |
    $1:
      - '([^\/]*)\/.*'