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

Recursive glob #3

Open
jimmyhmiller opened this issue May 4, 2022 · 8 comments
Open

Recursive glob #3

jimmyhmiller opened this issue May 4, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@jimmyhmiller
Copy link

It would be great to have this action support recursive globs so you can check files at any arbitrary level. By default bash has them not enabled. You can enable them by just running shopt -s globstar. But given the way all this is packaged up, not something that can be done as far as I can tell outside the action.

Adding that option to the script is technically a breaking change, so wanted to file an issue rather than a pr for it. Maybe this is a good option to add?

@caitlinelfring
Copy link
Member

Is what you're asking for the ability to run woke **/*.txt which would only run against all the text files recursively?

@jimmyhmiller
Copy link
Author

Running this action with **/*.txt only causes it to check files up to one folder deep. So it does not check my/very/nested/folder/file.txt. Ideally that would be possible.

@caitlinelfring
Copy link
Member

Got it, just making sure I'm understanding what you're asking. In older versions, this functionality was available (it still says so in the docs) but it clearly no longer works as expected.

I'm going to move this issue to https://github.com/get-woke/woke which is the repo where this should be handled. Thanks for reporting!

@caitlinelfring caitlinelfring transferred this issue from get-woke/woke-action May 6, 2022
@caitlinelfring caitlinelfring added the bug Something isn't working label May 6, 2022
@github-actions
Copy link

github-actions bot commented May 6, 2022

👋 Thanks for submitting your first issue!

Please be sure to read and follow our Code of Conduct and Contributing guide.

⭐️ Is your org or open source project using woke? If so, we'd love for you to be included in the 'Who uses woke' list at https://github.com/get-woke/woke/blob/main/docs/about.md#who-uses-woke.

@jimmyhmiller
Copy link
Author

It does work with woke generally. But woke is just relying on your shell for handling globs. If you turn on shopt -s globstar in your bash script it is all fixed.

I know this for sure because that's how I ended up getting around this. I didn't use this action and just installed woke in my custom action and enabled globstar

@caitlinelfring
Copy link
Member

Oh understood, thanks for clarifying. Was too quick in moving the issue to this repo 🙈. Will move back

@caitlinelfring caitlinelfring transferred this issue from get-woke/woke May 6, 2022
@caitlinelfring
Copy link
Member

If we wanted to add an option to enable globstar for this action, which would be disabled by default (adding something in https://github.com/get-woke/woke-action/blob/main/action.yml and then something like if [ "${INPUT_GLOBSTAR}" == "true"]; then shopt -s globstar; fi in https://github.com/get-woke/woke-action/blob/main/entrypoint.sh), could probably do that without changing the existing behavior.

But it might just be worth enabling by default and not even bothering with an input option, since this would be the preferred behavior. Thoughts?

@sebastien-rosset
Copy link

Got it, just making sure I'm understanding what you're asking. In older versions, this functionality was available (it still says so in the docs) but it clearly no longer works as expected.

Is this related to get-woke/woke#211? It would be useful to support glob patterns as input arguments to woke and not rely on the shell expanding glob patterns.

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

No branches or pull requests

3 participants