Skip to content
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

[BUG] Glob pattern for file without extension still reports no files changed #1647

Closed
2 tasks done
javierjulio opened this issue Oct 16, 2023 · 1 comment · Fixed by #1648
Closed
2 tasks done

[BUG] Glob pattern for file without extension still reports no files changed #1647

javierjulio opened this issue Oct 16, 2023 · 1 comment · Fixed by #1648
Labels
bug Something isn't working

Comments

@javierjulio
Copy link

javierjulio commented Oct 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

I'm trying to run a Dockerfile Lint workflow, only when applicable files have changed. I've been using the glob pattern **/Dockerfile* to match a Dockerfile at any directory level and those with file extensions e.g. Dockerfile.dev.

The changed-files action reports two sample Dockerfile's I'm using for testing, one already existed and was modified, the other was added. The debug output confirms that the action picks these up but for some reason the any_changed output is still false when it should be true.

To Reproduce

The following is the config I'm using. Note that it follows the GitHub glob pattern format which this action states it supports so I left this as is. Perhaps the glob pattern is incorrect.

      - uses: tj-actions/changed-files@v39
        id: changed-files
        with:
          files: |
            **/Dockerfile*

With a Dockerfile at the root and in a nested directory with other unrelated changes (e.g. YAML file), the output of any_changed is false when it should be true.

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-22.04

Expected behavior?

The value of any_changed should be true.

Relevant log output

As a security precaution, I don't want to share more than necessary but this should show the action is identifying the files changed by the any_changed is false.

This bug #829 is possibly related since it mentions that the only "other_changed" is listing matching files and I'm seeing the same behavior in the log output here.

2023-10-16T21:26:01.6601179Z ##[debug]Has git directory: true
2023-10-16T21:26:01.6601855Z ##[debug]Input file patterns: **/Dockerfile*
2023-10-16T21:26:01.6602609Z ##[debug]File patterns: **/Dockerfile*/**
2023-10-16T21:26:01.6603292Z ##[debug]Yaml file patterns: {}
2023-10-16T21:26:02.7069298Z Retrieving changes between 6107df4a271b02f5774dae04190d9fd83f3b8a79 (master) → 43cdf93ecbb72de69c6aeb42420d098c3203514f (test-consolidated-workflows)
2023-10-16T21:26:02.7081452Z [command]/usr/bin/git diff --name-status --ignore-submodules=all --diff-filter=ACDMRTUX 6107df4a271b02f5774dae04190d9fd83f3b8a79...43cdf93ecbb72de69c6aeb42420d098c3203514f
2023-10-16T21:26:02.7109626Z A	Dockerfile
2023-10-16T21:26:02.7110117Z A	config/test.yaml
2023-10-16T21:26:02.7110638Z M	config/test.yml
2023-10-16T21:26:02.7111173Z M	packages/cups/Dockerfile
2023-10-16T21:26:02.7117273Z ##[debug]All diff files: {"A":["Dockerfile","config/test.yaml"],"C":[],"D":[],"M":["config/test.yml","packages/cups/Dockerfile"],"R":[],"T":[],"U":[],"X":[]}
2023-10-16T21:26:02.7118954Z All Done!
2023-10-16T21:26:02.7119951Z ::endgroup::
2023-10-16T21:26:02.7120429Z ##[endgroup]
2023-10-16T21:26:02.7121524Z ::group::changed-files-patterns
2023-10-16T21:26:02.7122201Z ##[group]changed-files-patterns
2023-10-16T21:26:02.7153342Z ##[debug]All filtered diff files: {"A":[],"C":[],"D":[],"M":[],"R":[],"T":[],"U":[],"X":[]}
2023-10-16T21:26:02.7164868Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7166227Z ##[debug]Added files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7181248Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7182458Z ##[debug]Copied files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7185456Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7186849Z ##[debug]Modified files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7188122Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7189372Z ##[debug]Renamed files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7191150Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7193205Z ##[debug]Type changed files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7195865Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7197277Z ##[debug]Unmerged files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7198868Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7200262Z ##[debug]Unknown files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7203030Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7204625Z ##[debug]All changed and modified files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7206385Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7207799Z ##[debug]All changed files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7209239Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7211512Z ##[debug]All other changed files: {"paths":"Dockerfile config/test.yaml config/test.yml packages/cups/Dockerfile","count":"4"}
2023-10-16T21:26:02.7214474Z ##[debug]other_changed_files: ["Dockerfile","config/test.yaml","config/test.yml","packages/cups/Dockerfile"]
2023-10-16T21:26:02.7216548Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7217980Z ##[debug]All modified files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7219415Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7221434Z ##[debug]other_modified_files: ["Dockerfile","config/test.yaml","config/test.yml","packages/cups/Dockerfile"]
2023-10-16T21:26:02.7223182Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7224560Z ##[debug]Deleted files: {"paths":"","count":"0"}
2023-10-16T21:26:02.7225943Z ##[debug]Dir names include file patterns: []
2023-10-16T21:26:02.7227221Z ##[debug]other_deleted_files: []
2023-10-16T21:26:02.7227909Z All Done!
2023-10-16T21:26:02.7228770Z ::endgroup::
2023-10-16T21:26:02.7229286Z ##[endgroup]
2023-10-16T21:26:02.7284185Z ##[debug]Node Action run completed with exit code 0
2023-10-16T21:26:02.7305463Z ##[debug]Set output added_files = 
2023-10-16T21:26:02.7306316Z ##[debug]Set output added_files_count = 0
2023-10-16T21:26:02.7306816Z ##[debug]Set output copied_files = 
2023-10-16T21:26:02.7307582Z ##[debug]Set output copied_files_count = 0
2023-10-16T21:26:02.7308071Z ##[debug]Set output modified_files = 
2023-10-16T21:26:02.7308573Z ##[debug]Set output modified_files_count = 0
2023-10-16T21:26:02.7309058Z ##[debug]Set output renamed_files = 
2023-10-16T21:26:02.7309532Z ##[debug]Set output renamed_files_count = 0
2023-10-16T21:26:02.7310031Z ##[debug]Set output type_changed_files = 
2023-10-16T21:26:02.7310529Z ##[debug]Set output type_changed_files_count = 0
2023-10-16T21:26:02.7311035Z ##[debug]Set output unmerged_files = 
2023-10-16T21:26:02.7311509Z ##[debug]Set output unmerged_files_count = 0
2023-10-16T21:26:02.7311997Z ##[debug]Set output unknown_files = 
2023-10-16T21:26:02.7313064Z ##[debug]Set output unknown_files_count = 0
2023-10-16T21:26:02.7313755Z ##[debug]Set output all_changed_and_modified_files = 
2023-10-16T21:26:02.7314400Z ##[debug]Set output all_changed_and_modified_files_count = 0
2023-10-16T21:26:02.7314980Z ##[debug]Set output all_changed_files = 
2023-10-16T21:26:02.7315494Z ##[debug]Set output all_changed_files_count = 0
2023-10-16T21:26:02.7315998Z ##[debug]Set output any_changed = false
2023-10-16T21:26:02.7316465Z ##[debug]Set output only_changed = false
2023-10-16T21:26:02.7317320Z ##[debug]Set output other_changed_files = Dockerfile config/test.yaml config/test.yml packages/cups/Dockerfile
2023-10-16T21:26:02.7318212Z ##[debug]Set output other_changed_files_count = 4
2023-10-16T21:26:02.7318734Z ##[debug]Set output all_modified_files = 
2023-10-16T21:26:02.7319240Z ##[debug]Set output all_modified_files_count = 0
2023-10-16T21:26:02.7319748Z ##[debug]Set output any_modified = false
2023-10-16T21:26:02.7320207Z ##[debug]Set output only_modified = false
2023-10-16T21:26:02.7321176Z ##[debug]Set output other_modified_files = Dockerfile config/test.yaml config/test.yml packages/cups/Dockerfile
2023-10-16T21:26:02.7322326Z ##[debug]Set output other_modified_files_count = 4
2023-10-16T21:26:02.7322859Z ##[debug]Set output deleted_files = 
2023-10-16T21:26:02.7323370Z ##[debug]Set output deleted_files_count = 0
2023-10-16T21:26:02.7323841Z ##[debug]Set output any_deleted = false
2023-10-16T21:26:02.7324310Z ##[debug]Set output only_deleted = false
2023-10-16T21:26:02.7324786Z ##[debug]Set output other_deleted_files = 
2023-10-16T21:26:02.7325350Z ##[debug]Set output other_deleted_files_count = 0
2023-10-16T21:26:02.7326404Z ##[debug]Finishing: Run tj-actions/changed-files@v39
2023-10-16T21:26:02.7336866Z ##[debug]Evaluating condition for step: 'Run reviewdog/action-hadolint@v1'
2023-10-16T21:26:02.7363829Z ##[debug]Evaluating: (success() && (steps.changed-files.outputs.any_changed == 'true'))
2023-10-16T21:26:02.7364777Z ##[debug]Evaluating And:
2023-10-16T21:26:02.7369670Z ##[debug]..Evaluating success:
2023-10-16T21:26:02.7370356Z ##[debug]..=> true
2023-10-16T21:26:02.7370866Z ##[debug]..Evaluating Equal:
2023-10-16T21:26:02.7372523Z ##[debug]....Evaluating Index:
2023-10-16T21:26:02.7373034Z ##[debug]......Evaluating Index:
2023-10-16T21:26:02.7373543Z ##[debug]........Evaluating Index:
2023-10-16T21:26:02.7374061Z ##[debug]..........Evaluating steps:
2023-10-16T21:26:02.7374606Z ##[debug]..........=> Object
2023-10-16T21:26:02.7375128Z ##[debug]..........Evaluating String:
2023-10-16T21:26:02.7375675Z ##[debug]..........=> 'changed-files'
2023-10-16T21:26:02.7376315Z ##[debug]........=> Object
2023-10-16T21:26:02.7376802Z ##[debug]........Evaluating String:
2023-10-16T21:26:02.7377373Z ##[debug]........=> 'outputs'
2023-10-16T21:26:02.7377845Z ##[debug]......=> Object
2023-10-16T21:26:02.7378350Z ##[debug]......Evaluating String:
2023-10-16T21:26:02.7378853Z ##[debug]......=> 'any_changed'
2023-10-16T21:26:02.7379344Z ##[debug]....=> 'false'
2023-10-16T21:26:02.7379809Z ##[debug]....Evaluating String:
2023-10-16T21:26:02.7380290Z ##[debug]....=> 'true'
2023-10-16T21:26:02.7384647Z ##[debug]..=> false
2023-10-16T21:26:02.7385323Z ##[debug]=> false
2023-10-16T21:26:02.7389294Z ##[debug]Expanded: (true && ('false' == 'true'))
2023-10-16T21:26:02.7389930Z ##[debug]Result: false


### Has all relevant logs been included?

- [X] I've included all relevant logs

### Anything else?

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@javierjulio javierjulio added the bug Something isn't working label Oct 16, 2023
@github-actions
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant