Open justyn opened 4 years ago
Ah, I see what happened - these blank test files show as being renamed, that is why they don't show up as files_added
or files_removed
, and only the new "names" show up in files
.
This does show a bit of an inconsistency though, because it means:
files
= files_added
+ files_removed
+ files_modified
+ files_renamed
but there is no individual option to test for files_renamed.
I'm also interested to track renamed/moved files, reading this issue it seems that feature is not yet covered?
We've also run into an issue with not picking up renamed files. GitHub doesn't include the "old" file (one that was renamed) in the list of modified files. The old name is only included as an additional field on the renamed files entry, which the action code doesn't do anything with. Seeing that this issue has been around for a while, we are fixing it ourselves. Ticket is on our backlog at the moment, but I will be issuing a PR once we've established it works.
We've also run into an issue with not picking up renamed files. [...] Ticket is on our backlog at the moment
Who is "we" and what backlog is this? Is this involving this action or something else?
GitHub doesn't include the "old" file (one that was renamed) in the list of modified files
If it were just that then it wouldn't be too bad. I mean if at least the new name was listed in added files then it would be OK-ish for most users.
BTW: git diff --no-renames
Apologies, I realise my comment was a bit cryptic. I meant 'we' as in the company I'm working for at the moment, and the backlog being the one we have internally (which is pretty long!)
You're right that the issue isn't something that causes problems for the most part. It is only affecting my current team as we are using terraform in quite a specific way that depends on the file-changes-action to determine which .tf files have changed to then decide which files to run terraform apply
on.
Thanks for the tip about --no-renames
. It could help our situation.
I dug into the code a bit and while it is not documented like the rest of them, there is a files_renamed object that has the info I needed in it:
${{ steps.get_file_changes.outputs.files_renamed }}
I dont actually know js or typescript (im a python/R dev) but I think it is getting added here: https://github.com/trilom/file-changes-action/blob/a6ca26c14274c33b15e6499323aac178af06ad4b/src/FilesHelper.ts#L24-L30
Annnnnyways if you are having issues with this try accessing the renames directly with that path.
Describe the bug
files_added
andfiles_removed
are not showing in my test setup, onlyfiles_modified
is working correctly. Andfiles
which should show all, just shows modified and new.Workflow Here are the relevant parts of my workflow (other actions not shown include checkout):
Expected behavior
I'm removing three files (
four
,five
andsix
), adding three files (one
,two
andthree
), modifying one file (run_checks.sh
), each in their own commit, then pushing these commits to a branch with a Pull Request.I would expect this:
Actual output:
Not quite sure what is going on here!
Particularly strange that the added files are not showing in
files_added
but they are infiles
.