We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When using the setup-action on a self-hosted runner, the composer setup fails (without exiting) due to lack of permission.
Version
v1
v2
Runners
Operating systems
Docker/Ubuntu
PHP versions
Tested with 8.0.8, probably happening with every version
To Reproduce
Try to setup-php in a self-hosted agent without root user:
- name: Install PHP uses: shivammathur/setup-php@v2 with: php-version: "8.0" ini-values: memory_limit=-1 tools: composer:v2 extensions: apcu, mongodb, redis, sockets, sodium
Expected behavior
Setup composer properly
==> Setup PHP ✓ PHP Installed PHP 8.0.8 ==> Setup Tools ✓ composer Added composer 2.1.3 ==> Setup Extensions ✓ apcu Enabled ✓ mongodb Enabled ✓ redis Enabled ✓ sockets Enabled ✓ sodium Enabled ==> Add php.ini values ✓ memory_limit=-1 Added to php.ini ==> Support this project ✓ setup-php https://setup-php.com/support
Screenshots/Logs
==> Setup PHP ✓ PHP Installed PHP 8.0.8 ==> Setup Tools tee: /home/runner/.composer/composer.json: Permission denied chmod: cannot access '/home/runner/.composer/composer.json': No such file or directory [ErrorException] touch(): Unable to create file /home/runner/.composer/config.json because Permission denied config [-g|--global] [-e|--editor] [-a|--auth] [--unset] [-l|--list] [-f|--file FILE] [--absolute] [-j|--json] [-m|--merge] [--append] [--] [<setting-key>] [<setting-value>]... ✓ composer Added composer 2.1.3 ==> Setup Extensions ✓ apcu Enabled ✓ mongodb Enabled ✓ redis Enabled ✓ sockets Enabled ✓ sodium Enabled ==> Add php.ini values ✓ memory_limit=-1 Added to php.ini ==> Support this project ✓ setup-php https://setup-php.com/support
Additional context
There's a missing sudo in the tee command on commons.sh
sudo
tee
commons.sh
setup-php/src/scripts/common.sh
Lines 235 to 238 in 0b33ef4
But that might not solve the problem, not using sudo at all or ensuring that the folder is accessible by the current user would be a better approach.
Are you willing to submit a PR?
Yes, once agreed with one of the suggestions above.
The text was updated successfully, but these errors were encountered:
@lucasmdrs Fixed in 36cb9fb Now the composer's home directory will be owned by the current user, and that should fix this issue.
Sorry, something went wrong.
shivammathur
No branches or pull requests
When using the setup-action on a self-hosted runner, the composer setup fails (without exiting) due to lack of permission.
Version
v1
orv2
.v2
v1
Runners
Operating systems
Docker/Ubuntu
PHP versions
Tested with 8.0.8, probably happening with every version
To Reproduce
Try to setup-php in a self-hosted agent without root user:
Expected behavior
Setup composer properly
Screenshots/Logs
Additional context
There's a missing
sudo
in thetee
command oncommons.sh
setup-php/src/scripts/common.sh
Lines 235 to 238 in 0b33ef4
But that might not solve the problem, not using
sudo
at all or ensuring that the folder is accessible by the current user would be a better approach.Are you willing to submit a PR?
Yes, once agreed with one of the suggestions above.
The text was updated successfully, but these errors were encountered: