watchflow icon indicating copy to clipboard operation
watchflow copied to clipboard

fix: FilePatternCondition never checks files — _get_changed_files() always returns empty list

Open codesensei-tushar opened this issue 7 months ago • 0 comments

The _get_changed_files() method in src/rules/conditions/filesystem.py (line 118) is a placeholder that returns [] for both PR and push events. This means conditions like files_match_pattern and files_not_match_pattern never actually evaluate any files — every check silently passes with an info-level "no files to check" message.

The data is already available — the PR enricher populates changed_files as a list of dicts with filename, status, etc. The method just isn't reading it.

Proposed fix:

  • For PR events: read filenames from event["changed_files"] (populated by the enricher)
  • For push events: collect filenames from event["commits"] → added / modified / removed arrays, deduplicated
  • Fall back to [] only if neither source has data

codesensei-tushar avatar Apr 09 '26 04:04 codesensei-tushar