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

Not global acces for tool installed with composer global require #216

Closed
Wtyd opened this issue May 3, 2020 · 4 comments · Fixed by #219
Closed

Not global acces for tool installed with composer global require #216

Wtyd opened this issue May 3, 2020 · 4 comments · Fixed by #219
Labels
workflow-edit Issue can be fixed by editing the GitHub Action workflow

Comments

@Wtyd
Copy link

Wtyd commented May 3, 2020

Describe the bug
I have to install another library not supported like parallel-lint. I install with composer global require but the only form to run the tool is with absolut path /home/runner/.composer/vendor/bin/parallel-lint --version. I have not global access.

To Reproduce
feature.zip

Expected behavior
If I install a tool with global composer require I would like to have access to it globally.

Screenshots
imagen

Additional context
I tried to add to $PATH the composer global path (/home/runner/.composer/vendor/bin) but neither works.

@shivammathur
Copy link
Owner

shivammathur commented May 3, 2020

Each step in your workflow runs as a separate process, so exporting $PATH in one step has no effect on further steps.

GitHub Actions provides a syntax to add a folder to $PATH.

-  - name: Export path
-    run: export PATH=$PATH:/home/runner/.composer/vendor/bin
+  - name: Export path
+    run: echo "::add-path::$(composer -q global config home)/vendor/bin"

Here is a test workflow - https://github.com/shivammathur/test-setup-php/actions/runs/94496048/workflow

@shivammathur shivammathur added the workflow-edit Issue can be fixed by editing the GitHub Action workflow label May 3, 2020
@kasperg
Copy link

kasperg commented May 4, 2020

Have you considered adding this per default?

@shivammathur
Copy link
Owner

@kasperg Yes, in next release.

@shivammathur shivammathur mentioned this issue May 13, 2020
@shivammathur
Copy link
Owner

@kasperg @Wtyd Now composer bin directory will be in PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow-edit Issue can be fixed by editing the GitHub Action workflow
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants