Unlike most package managers, the team behind Composer have opted for a system which, by default, relies upon talking directly to the GitHub API. Unfortunately, GitHub impose a rate limit on their API which means occasionally you may receive an error from composer asking you to login with your GitHub credentials.
There are two ways to resolve this issue on Viaduct - you can choose either of them.
The first option is simply to adjust your composer command to include
--prefer-source which means that it will use Git itself to fetch dependencies rather than then GitHub API. The final command will look something like this:
composer --prefer-source --no-interaction
Add a GitHub API Key
As an alternative, you can provide composer with an OAuth token which will grant you your own rate limit rather than using one shared by all Viaduct users.
Login to your GitHub account.
Go to your Settings page and choose Applications.
Under the Personal Access Tokens section, select Generate New Token.
Enter a description (something like Viaduct) and you don't need any of the scopes to be selected.
- Add a new build command (at the top of the list) to run
composer config -g github-oauth.github.com <oauthtoken>. Be sure to replace
<oauthtoken>with the token provided by GitHub.
- Re-deploy your application.