-
Notifications
You must be signed in to change notification settings - Fork 1.6k
glob: skip error when subdirectory have not permission #1015
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
base: main
Are you sure you want to change the base?
Conversation
actions/runner#1678 As a result, I have seen many OSS repositories with PRs to not use globstar. (See PR linked in related issue). |
This seems to be a common issue w/ not only me, but many people using actions/cache. My tests have been failing because of this, would be awesome if we can get this merged! Thanks for making this pr @howyi @thboop @konradpabjan would you be able to help get this over the line? |
@thboop @konradpabjan @bishal-pdMSFT @brcrista @luketomlinson |
Hey @howyi , could you describe this user scenario a little more?
Are you mounting in volumes that the runner user does not have read access to? What purpose do those files or mounts serve? Silently ignoring files we don't have permission to read could lead to unexpected behavior for users as well, so i'm curious what scenarios this fix enables. |
@thboop Thanks for the reply!!!
I understand. In my example, I had MySQL data mounted locally. This technique is described on the MySQL DockerHub If I had done this mount, the directory where mysql is mounted would be
I believe the current situation is behaving unexpectedly. Also, unless you turn on DEBUG logging, this error is not detailed and you will spend a lot of time investigating. |
@thboop Many people are facing this problem, could you review it? |
fix: #775
When globstar(
**
) is used in a directory with non-referenced subdirectories, the following differences exist between shell and @actions/glob.Sample directory structure
shell(bash/zsh): skip no permission subdirectories
@actions/glob: error
output
Problems caused by this difference
When using hashFiles in @action/cache, etc., you may use the form
hashFiles('**/package-lock.json')
.ex: https://docs.github.com/ja/actions/using-workflows/caching-dependencies-to-speed-up-workflows#example-using-the-cache-action
If there is an unprivileged directory, this caching process will fail with an error.
Related issue: actions/cache#753 (comment)
I have created a repository that reproduces this situation. Check here for details. 🐔
https://github.com/howyi/gha-hashfiles-parmission-check