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

composer version doesn't respect custom bin directory #23

Open
splatEric opened this issue May 2, 2023 · 2 comments
Open

composer version doesn't respect custom bin directory #23

splatEric opened this issue May 2, 2023 · 2 comments

Comments

@splatEric
Copy link

A project I work on is using this action, and began failing with the switch to the composer being the version used by default. It transpires that this is because the composer config contains:

  "config": {
    "bin-dir": "bin"
  }

and the action bash script has a hardcoded expectation that the bin directory is in vendor

I understand that this is an edge case you may not want to support. But wanted to flag it up for anyone else hitting the same issue (your docs very clearly point out that it's looking for vendor/bin, but apparently not clearly enough for me!!) We've configured to using latest

@g105b
Copy link
Member

g105b commented May 2, 2023

Hi @splatEric

Sorry for causing this issue - I should have been more rigorous on the release messaging. Thanks for bringing this to my attention.

I'm glad you've got a solution here, but it's something I should take note of. I'll keep this issue open for when I have some time to implement.

@dlondero
Copy link

Hi @g105b just got into this problem with a project that as an alternate vendor binary location. So I might give it a shot to contribute a PR for fixing this. Do you have already some ideas about how you wanted to solve this?

There are two ways to define an alternate vendor binary location (see https://getcomposer.org/doc/articles/vendor-binaries.md#can-vendor-binaries-be-installed-somewhere-other-than-vendor-bin-):

  1. Setting the bin-dir configuration setting in composer.json
  2. Setting the environment variable COMPOSER_BIN_DIR

Was thinking to look for bin-dir in composer.json with jq/awk/whatever and start from there to see if there's anything or eventually fallback to vendor/bin/phpstan as VENDOR_BIN. Would that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants