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.json based on environment #258

Open
badasukerubin opened this issue Sep 5, 2024 · 6 comments · May be fixed by #261
Open

composer.json based on environment #258

badasukerubin opened this issue Sep 5, 2024 · 6 comments · May be fixed by #261
Labels
question Further information is requested

Comments

@badasukerubin
Copy link

How do I... ?

Use a different composer.json, e.g. composer.gh-actions.json (in the root directory) instead of defining a working-directory to another directory.

Example code

E.g.

  • name: Install composer dependencies
    uses: ramsey/composer-install@v3
    with:
    working-composer: 'composer.gh-actions.json'
@badasukerubin badasukerubin added the question Further information is requested label Sep 5, 2024
@flagbrad
Copy link

flagbrad commented Sep 6, 2024

I believe the COMPOSER environment variable lets you do this, as documented here. However, the filename composer.json seems to be hardcoded here in this action.

A workaround might be to add zero-byte composer.json and composer.lock files to your repo to satisfy this script's looking for them... not sure though.

@badasukerubin
Copy link
Author

Yes, I've read Composer's doc and seen the hardcoded composer.json file, I planned to open a PR if I didn't get a solution soon.
Could you elaborate on the zero-byte composer.json and composer.lock files?

@flagbrad
Copy link

flagbrad commented Sep 6, 2024

@badasukerubin This GitHub action tests for the existence of composer.json and composer.lock. It doesn't actually use these filenames when invoking composer (composer uses the environment variable COMPOSER), but not having these files in existence causes the action to have problems.

I have not tested this (I'm not the script author, just an interested person). But it looks like so long as these files exist, this action will be happy. So if you just make placeholder files with these names, this action may work for now. It still seems like a bug, but this may work around the problem.

@ramsey
Copy link
Owner

ramsey commented Sep 6, 2024

I'd accept a PR that allows you to customize the name of the Composer file.

@badasukerubin
Copy link
Author

I'm working on a PR

@badasukerubin badasukerubin linked a pull request Sep 12, 2024 that will close this issue
7 tasks
@badasukerubin
Copy link
Author

Opened a PR: #261
cc @ramsey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants