watchflow
watchflow copied to clipboard
fix: FilePatternCondition never checks files — _get_changed_files() always returns empty list
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/removedarrays, deduplicated - Fall back to
[]only if neither source has data