-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Composer is not running as a current user (it runs as root) #90
Comments
Hi @gleniat, The instance of Composer runs in a Docker container, with no users created within it. It might take a bit of thinking to get the inside of the container running with the same user as the file owners on the outside. What problem are you facing due to the files being owned by root? |
I had the same issue. In my case a product specific composer plugin created var/tmp/… folders after To ensure that the folders created by composer install will be writable during the unit tests, I switched to:
|
A first approach to this problem may be allowing the user to set the user with which they want to run the docker container. You can set the I'm not familiar with this codebase or even with GithubActions development but it looks like an Edit: my fork appears to work correctly. It's not automatic user discovery but it at least allows to set the user for docker which solves my problem.
|
@Andalu30 this looks really promising! We can test on https://github.com/php-actions/example-composer if you like? Would you be able to create a test workflow there, or if you can share the one you're testing on, I can add this test to the example-composer repo. |
This is an issue when using pestphp/pest with the coverage option, as by default they store in the vendor directory. |
I set up the linux user
runner
on my self-hosted linux machine. I installed the service withsudo ./svc.sh install runner
and started it with./svc.sh start
. The installed runner runs asrunner
user, but thephp-actions/composer
createsvendor
directory owned byroot
.whoami prints
runner
as expected.after
Install composer dependencies
step, the listing of files look like this:How can I run
php-actions/composer@v6
as a current user so vendor folder is created asrunner:runner
?The text was updated successfully, but these errors were encountered: