-
-
Notifications
You must be signed in to change notification settings - Fork 236
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
pathspec 'x' did not match any files #227
Comments
Will try to add a failing test for this case later this week. (Seems easy to test by adding 2 file patterns but only adding 1 dirty file) Wonder if this could be solved by adding - name: Commit changed files
if: "github.event_name == 'repository_dispatch'"
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Apply phpstan-baseline changes
branch: ${{ github.head_ref }}
file_pattern: '*.neon *dba.cache'
+ add_options: '--ignore-errors' |
thx for the fast reply.
I tried that and it resulted in the same error:
|
This test confirms the problem mentioned in #227. If `file_pattern` contains a pattern of, for example 2 file extensions, and only files for one extensions are dirty but not for the otherone, `git-add` will throw a fatal error. It does not throw an error if the files for the pattern already exist but are not dirty.
I've added 2 tests covering this issue in 571d6b7. The file pattern I've used: What I've discovered:
We could solve this problem by adding yet another option to this action. Something like a But this seems to be very rare edge case. I would like the keep the Action simple and not riddled with solutions for edge cases. :) For your specific problem, it would probably make sense to add an empty |
Thx for investigating. I think I can work arround this problem on my end, without a new option. Maybe its worth a note in the readme? |
Will add a note for this in the README. |
@staabm Were you able to find a workaround for this? I have recently encountered the same issue, and was wondering if you were able to get around this with one of the existing parameters. |
@erikumhoefer i went with what was suggested above
|
Hi @stefanzweifel , |
Hi! Yes, + 1. I'm having the same problem, I'm creating an automatic formatter and sometimes it only contains js and sometimes only css but it throws an error that no such file exists, I would also suggest that there should be some option to handle this kind of case. Anyway, this little script is very good and easy to use, thanks a lot :) |
@Gellipapa @cathex-matt Would you both be able to share your current workflows here? (The exact configuration you're using for I obviously also would like to solve this issue, but after re-reading my proposed solution from a year ago (#227 (comment)), I don't think that adding an additional option would really solve the problem.
|
@stefanzweifel Hi! So I solved the problem by selecting the extension of the files in a python script and passing it to filter_pattern.
|
I also have the same problem, my workflow generates |
@stefanzweifel Should we keep discussing/motivating a change in this issue, or would you prefer if a new one is opened? I think having a built-in way to handle this would be much appreciated and useful. |
@MPV If it's about a proposal on how to handle these errors in a built-in way, I would say feel free to open a new issue/discussion. |
Version of the Action
v4
Describe the bug
In a workflow, which sometimes changes x.neon or x.dba.cache files, I am running into the following error:
I am wondering that the pathspec is handled as required files.. we don't generate this files every time.. so I didn't expect this error
To Reproduce
.
Expected behavior
No error, since the pattern matched at least one of the path specs
Screenshots
If applicable, add screenshots to help explain your problem.
Used Workflow
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: