actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

Feature request: Check that globs in `on.*.paths` match at least one file

Open allanlewis opened this issue 8 months ago • 0 comments

It would be useful to me if Actionlint could report when globs in on.*.paths don't match any files.

The following shell pipeline approximates what I'd like to do:

git ls-files -- '.github/workflows/*.yml' \
  | parallel "yq -o json {} | jq -r '.on | to_entries[].value | .paths // empty | .[]' 2>/dev/null" \
  | sort -u \
  | parallel -k --bar --tag "git ls-files --error-unmatch :{} >/dev/null"

However, this obviously uses Git's pattern syntax which probably differs from GitHub's in some subtle respects.

allanlewis avatar May 29 '24 08:05 allanlewis