Skip to content

Inject GITHUB_TOKEN in composer config when present #42

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

Merged

Conversation

weierophinney
Copy link
Member

In laminas-api-tools/api-tools-rpc#8, I ran into an issue whereby installing lowest or latest dependencies resulted in the Composer error "Could not authenticate against github.com", which occurs when rate limits have been reached.

These can be prevented by providing the GITHUB_TOKEN secret to the container, and using it to configure Composer to authenticate against GitHub.

The patch also fixes errors flagged by shellcheck.

To help prevent hitting rate limits.

Patch also fixes errors flagged by shellcheck.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney added this to the 1.10.0 milestone Jun 2, 2021
Comment on lines +167 to +170
# If a token is present, tell Composer about it so we can avoid rate limits
if [[ "${GITHUB_TOKEN}" != "" ]];then
composer config --global github-oauth.github.com "${GITHUB_TOKEN}"
fi
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the primary change to review.

@weierophinney weierophinney merged commit b483292 into laminas:1.10.x Jun 2, 2021
@weierophinney weierophinney deleted the hotfix/composer-github-token branch June 2, 2021 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants