tj-actions / changed-files

:octocat: Github action to retrieve all (added, copied, modified, deleted, renamed, type changed, unmerged, unknown) files and directories.
MIT License
1.8k stars 192 forks source link

[Feature] Add support for detecting changed files in nested submodules #2140

Open harrisonfang-helm opened 4 months ago

harrisonfang-helm commented 4 months ago

Is there an existing issue for this?

Does this issue exist in the latest version?

Describe the bug?

The changed-files action can't detect changed files in nested submodules. Related to https://github.com/tj-actions/changed-files/issues/349 when the submodule feature was first added.

To Reproduce

  1. Create 3 repositories with the following relationship:
    • Repository 1 has repository 2 as a submodule
    • Repository 2 has repository 3 as a submodule
      1. Commit a change to repo 3 that modifies any file.
      2. Commit a change to repo 2 that only updates submodule 3 (to contain the commit from step 2).
      3. Create a PR for repo 1 that only updates submodule 2 (to contain the commits from steps 2 and 3).
      4. Triggering a changed-files action from this PR (step 4) will fail to detect the modified file from step 2.

See here for an example:

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-22.04

Expected behavior?

The changed-files action should be able to detect changed files in nested submodules.

Relevant log output

see here for the full debug logs: https://github.com/harrisonfang-helm/changed-files-submodule-mre-1/actions/runs/9458717183/job/26054693835

##[debug]Evaluating condition for step: 'Run tj-actions/changed-files@v44'
##[debug]Evaluating: success()
##[debug]Evaluating success:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Run tj-actions/changed-files@v44
##[debug]Loading inputs
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Evaluating: github.api_url
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'api_url'
##[debug]=> 'https://api.github.com'
##[debug]Result: 'https://api.github.com'
##[debug]Loading env
Run tj-actions/changed-files@v44
::group::changed-files
changed-files
::group::changed-files-all
changed-files-all
##[debug]Node Action run completed with exit code 0
##[debug]Set output added_files = 
##[debug]Set output added_files_count = 0
##[debug]Set output copied_files = 
##[debug]Set output copied_files_count = 0
##[debug]Set output modified_files = 
##[debug]Set output modified_files_count = 0
##[debug]Set output renamed_files = 
##[debug]Set output renamed_files_count = 0
##[debug]Set output type_changed_files = 
##[debug]Set output type_changed_files_count = 0
##[debug]Set output unmerged_files = 
##[debug]Set output unmerged_files_count = 0
##[debug]Set output unknown_files = 
##[debug]Set output unknown_files_count = 0
##[debug]Set output all_changed_and_modified_files = 
##[debug]Set output all_changed_and_modified_files_count = 0
##[debug]Set output all_changed_files = 
##[debug]Set output all_changed_files_count = 0
##[debug]Set output any_changed = false
##[debug]Set output only_changed = false
##[debug]Set output other_changed_files = 
##[debug]Set output other_changed_files_count = 0
##[debug]Set output all_modified_files = 
##[debug]Set output all_modified_files_count = 0
##[debug]Set output any_modified = false
##[debug]Set output only_modified = false
##[debug]Set output other_modified_files = 
##[debug]Set output other_modified_files_count = 0
##[debug]Set output deleted_files = 
##[debug]Set output deleted_files_count = 0
##[debug]Set output any_deleted = false
##[debug]Set output only_deleted = false
##[debug]Set output other_deleted_files = 
##[debug]Set output other_deleted_files_count = 0
##[debug]Finishing: Run tj-actions/changed-files@v44

Has all relevant logs been included?

Anything else?

No response

Code of Conduct

tj-actions-bot commented 4 months ago

Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience.