Skip to content

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

@codesensei-tushar

Description

@codesensei-tushar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions