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

All output owned by root #13

Open
joeyparrish opened this issue Dec 20, 2021 · 4 comments
Open

All output owned by root #13

joeyparrish opened this issue Dec 20, 2021 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@joeyparrish
Copy link

It seems that all output generated by this action is owned by root. This means any follow-up modifications to the files need to either use sudo or be proceeded by a call to chown on the docfx output.

If there are no objections, I'll put together a PR to address this.

@joeyparrish
Copy link
Author

Actually, I have not been successful in finding a solution to this yet. I thought it would be simpler.

@nikeee
Copy link
Owner

nikeee commented Dec 20, 2021

What was the approach you attempted?

This action uses a docker image. It would probably suffice to put a USER xyz somewhere in the Dockerfile. Any suggestions?

@nikeee nikeee assigned nikeee and unassigned nikeee Dec 20, 2021
@nikeee nikeee added the help wanted Extra attention is needed label Dec 20, 2021
@joeyparrish
Copy link
Author

I believe that would only change the user inside the docfx docker container, but not the owner of the files outside the container. Ideally, the non-root user invoking the action would own the files afterward.

Perhaps an argument or env variable could be used to pass a UID that would own the output, but I haven't tried yet. I got as far as figuring out that with a Docker-based action, there's no way to run anything extra outside the Docker container.

@robtimus
Copy link

I believe that would only change the user inside the docfx docker container, but not the owner of the files outside the container. Ideally, the non-root user invoking the action would own the files afterward.

From my experience, files in Linux use the user id to determine the owner. If you pass a user id from the outside to Docker, then files created from within Docker will be owned by that user.

However, GitHub explicitly documents that USER should not be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants