Issue Reproduced

I run into this issue while performing ahoy build command for a client site, which will initiate the GovCMS environment, including running the composer install command inside the docker container to the install the required modules from the drupal modules repositories. And that have triggered the error: In ConfigCommand.php Line 322: github-oauth.github.com is not defined and process "/bin/sh -c composer config -global github-oauth.github.com $GOVCMS_GITHUB_TOKEN" did not complete successfully: exit code: 1.

You can find the exact error in the following screenshot:

2024-05-02T111134


Resolution of Error

The error occurs inside the docker container, where it cannot find the variable $GOVCMS_GITHUB_TOKEN, as a result it cannot pull some of the packages via the composer command. To resolve this, we can use a docker-compose.override.yml file to overide and add the $GOVCMS_GITHUB_TOKEN variable for the docker container.

For my instance I will need to create this file at the root directory as the follows:

2024-05-02T171646

and have the following lines of configuration to set the environmental variables:

1
2
3
4
5
6
services:
  cli:
    build:
      args:
        GITHUB_Key: ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXX
        GOVCMS_GITHUB_TOKEN: ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXX