Code Monkey home page Code Monkey logo

Comments (6)

szepeviktor avatar szepeviktor commented on May 20, 2024

php-actions/composer runs a Docker container so your environment variable does not reach that.

Try simply running Composer

      - name: "Install dependencies with Composer"
        env:
          ACF_PRO_KEY: "${{ secrets.ACF_PRO_KEY }}"
        run: "composer update --no-interaction --no-progress"

from private-composer-installer.

amustill avatar amustill commented on May 20, 2024

Thanks for the response @szepeviktor.

This is my first attempt at using GitHub Actions (coming from GitLab CI) so apologise if I'm incorrect, but my understanding of the documentation is that passing the env config to step will set it within it? Additionally the author of php-actions/composer suggest this is also correct.

For the time being I have found a solution by adding an additional step before php-actions/composer which dumps my global ACF_PRO_KEY in to an .env file. This installs the package without issue.

- name: Create .env
  run: |
    echo "ACF_PRO_KEY=$ACF_PRO_KEY" > .env

- name: Install dependencies
  uses: php-actions/composer@v5
  with:
    php_version: '7.4'

Would this not counter your argument of the environment variable not being accessible to the Docker container?

I'm not entirely comfortable with this as a solution, but at the moment it appears to be the only way to get ffraenz/private-composer-installer and php-actions/composer to play nicely with each other.

from private-composer-installer.

szepeviktor avatar szepeviktor commented on May 20, 2024

but my understanding of the documentation is that passing the env config to step will set it within it

There is no problem with that. php-actions/composer will receive the env but php-actions/composer itself starts up a container and does not pass local env to that container.

from private-composer-installer.

szepeviktor avatar szepeviktor commented on May 20, 2024

Would this not counter your argument of the environment variable not being accessible to the Docker container?

I simply never used php-actions/composer.

from private-composer-installer.

amustill avatar amustill commented on May 20, 2024

Thanks again @szepeviktor.

Skipping php-actions/composer and manually running Composer is certainly an option worth considering and is something I can investigate at a later date. For now the deployment is working at least.

I'll take the issue back to php-actions/composer and close this once I've heard back.

from private-composer-installer.

amustill avatar amustill commented on May 20, 2024

The author of php-actions/composer has confirmed it is a bug their end, so I'm closing this.

from private-composer-installer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.