-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
Action fails on empty repo or when the specific file pattern is not found #976
Comments
Thanks for reporting this issue, don't forget to star this project if you haven't already to help us reach a wider audience. |
Hi @DanielRejniak I believe Issue 1 has been fixed, and Issue 2 is an expected outcome to prevent potential misconfigured patterns |
We are using - id: golang-changed
uses: tj-actions/changed-files@v16
with:
files: |
**/*.go
files_ignore: |
**/vendor/**
- if: steps.golang-changed.outputs.any_changed == 'true'
... This is working, but now fails in the latest version with I still think this is a valid use-case for the action. Could perhaps a toggle be added to not throw an error if there's no match or changed files? Note: I think this relates to #992 as well |
This has been resolved and would be released momentarily. Going forward patterns not matching any files would result in a warning. cc: @s4nji, @DanielRejniak |
Is there an existing issue for this?
Does this issue exist in the latest version?
Describe the bug?
I found several issues with the
tj-actions/changed-files
action, those are especially predominant when the repository is empty. Bellow are two scenarios that I reproduced on my private dummy repo for the purpose of demonstration.Actions :
tj-actions/changed-files
Version :
v35.5.1
To Reproduce
Issue One
This appears to happen on brand new repo when there was no previous commits.
See job failures : https://github.com/DanielRejniak/tj-actions-bug-replication/actions/runs/4134902304/jobs/7146633425
Issue Two
After I made a dummy commit the repo now has previous commits. I then re-run the workflow and and I use a glob pattern of
test_dir/**/*.yaml
as Im only interested in those files. However the action fails saying thatNo paths found using the specified patterns
.See job failures : https://github.com/DanielRejniak/tj-actions-bug-replication/actions/runs/4134958441/jobs/7146768376
What OS are you seeing the problem on?
all
Expected behavior?
I would have expected the list of changes to be empty in both cases. In the first case the repo is blank there are no changes so I should recieve an empty list. In the second case the repo has commit's but no files that Im looking for so again I should recieve empty list of changed files.
Relevant log output
Issue One Log
Issue Two Log
Run tj-actions/changed-files@v35.5.1 Run # "Calculating the previous and current SHA..." changed-files-diff-sha Run tj-actions/glob@v16 /usr/bin/git rev-parse --show-toplevel /home/runner/work/tj-actions-bug-replication/tj-actions-bug-replication /usr/bin/git diff --diff-filter=D --name-only 91b75eba4f9c38e09c039d4920d3571b71786f72..00421671d4b77b8e9183928f7fc68bb652593592 Error: No paths found using the specified patterns
Anything else?
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: