Drupal

How to install premium modules using composer in a CircleCI-based deployment pipeline?

60 views June 30, 2025 0

If you’re deploying a Drupal site using Composer in CircleCI and want to avoid using a personal GitHub token (to access private packages like miniorange_saml_enterprise), you can follow these detailed steps to securely store and use the token at the repository level:
Step-by-Step Solution:

Step 1: Add GitHub Token as an Environment Variable in CircleCI

    1. Log in to CircleCI.
    2. Navigate to your project.
    3. Click on Project Settings > Environment Variables.
    4. Add a new variable:
      1. Name: GITHUB_TOKEN
      2. Value: your-github-token-here

      This ensures the token is stored securely and not hardcoded in your pipeline or codebase.

      Step 2: Configure Composer to Use the Token During the CI/CD Build
      In your CircleCI config file (.circleci/config.yml), add a step before running composer install to inject the token into Composer:

      Example:

      - run:
          name: Configure Composer with GitHub Token
          command: |
              composer config --global github-oauth.github.com $GITHUB_TOKEN

      This command tells Composer to use the GitHub token from the environment variable for authentication, allowing access to private repositories during
      dependency installation.

       

Was this helpful?


Hello there!

Need Help? We are right here!

support