Skip to content

Treat renamed files as modified #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mangunowsky
Copy link

@mangunowsky mangunowsky commented Feb 26, 2025

First of all thank you for this action, it's been very useful!

This PR aims to fix corner-case where renamed files are not included in action's output, even if they were modified, which happens a lot during refactor process.

Rationale:
The compareCommits function currently categorizes files as either added or modified, which works for new and changed files. However, renamed files were previously ignored. This exclusion led to an incomplete list of files when generating coverage reports.

In many cases, renaming a file in a Git repository is akin to modifying its path, and the file’s content might still require coverage validation even if the content itself has not changed. By treating renamed files as modified (since they may still affect the codebase), we ensure that:

  • Renamed files are properly included in coverage reports: This ensures that even if a file is renamed but not modified, its coverage is still tracked.
  • Renamed AND modified files are no longer ignored.
  • The action remains consistent with the GitHub API's handling of renamed files: The GitHub API marks these files as renamed, and we now account for them properly in the coverage logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant