-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Wildcard expansion can affect INPUT_FILE_PATTERN before it's passed to git status/add #153
Comments
Thanks for reporting! I think instead of setting For some reason I've deliberately disabled the shellcheck for these calls. (Can't remember why) |
Hey Stefan, thanks for the quick response. Quoting was also my first thought, but I don't think quoting will work in the case of specifying 2+ pathspecs, e.g.:
I think if you were to quote $INPUT_FILE_PATTERN in this case, git would interpret it as a single pathspec with a space in the middle. |
@ryandy Howdy, I've created a PR in #154 which would solve this problem. I've decided to add a new option called Would be great if you could update your workflow like seen below and report, if this solution solves your problem. -- uses: stefanzweifel/git-auto-commit-action@v4
+- uses: stefanzweifel/git-auto-commit-action@fixes/153
+ with:
+ disable_globbing: true (As mentioned in the PR, I don't feel comfortable disabling globbing for all users. 🤷 ) |
I tested it out, and that works for me. Thanks for pulling this together! |
I've just tagged a new minor version which includes the I will close this issue now. Thanks again for reporting this! |
Do you think I just spent several hours tracking down why this action no longer seemed to be working in my repo, when:
It turns out someone added |
@spookylukey Thanks for bringing this up again. Sorry that you wasted hours on this issue :/ When I've added Wouldn't be something I would change in a minor version but something that we could consider doing in v5. (I currently don't have big plans for this Action, as it works great for my use case – and for many others too. I still have a private note where I collect improvements and changed that could be made in v5. Added this to the list) |
Version of the Action
v4.9.2
Describe the bug
If INPUT_FILE_PATTERN contains a wildcard, the shell will attempt to expand it to the name(s) of matching files if they exist. This list of filenames will then be passed to
git status
andgit add
as part of_git_is_dirty()
and_add_files()
, instead of the originally specified string. The list of files (obtained from shell globbing) can differ from the list of files that would have matched using git pathspec.To Reproduce
"*.py"
.git status
. Because setup.py was not modified,git status
will report no change.Expected behavior
git status
should report that package/module.py was modified. And thengit add
should add package/module.py.Possible fix
Running
set -o noglob
in entrypoint.sh will turn off glob file expansion. This could probably be run at the top of the script, but could also be run in a more local, targeted fashion, so long as it covers both the call to git status and git add.The text was updated successfully, but these errors were encountered: