I was on craft v3.7.24, but I needed bugfixes in Both Craft update console command and composer told me they couldn't authenticate against GitHub and/or needed an API token.

composer update craftcms/cms
Loading composer repositories with package information
Updating dependencies                                 
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading craftcms/cms (3.7.24 => 3.7.26)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Downloading craftcms/cms (3.7.26)

Could not fetch https://api.github.com/repos/craftcms/cms/zipball/97c8598b3c71a1b88e6bbe4ee35c3720e5fa5d7e, please review your configured GitHub OAuth token or enter a new one to access private repos
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+soeren-ThinkPad-T470p+2021-12-22+1737
to retrieve a token. It will be stored in "/home/soeren/.config/composer/auth.json" for future use by Composer.
Token (hidden):

I "solved" the problem by providing one, but I don't think that's a real solution, because there is absolutely no reason why I should need an authentication against GitHub when updating craft via composer. When googling this was the only solution I found. Not a single post doubting composer needed any authentication to download a public zipball.

It might be completely unrelated to CraftCMS and instead due to some forked repositories I hostED at GitHub. However, they aren't on GitHub anymore (using bitbucket now) and they shouldn't have been affected by the update anyway. If anybody has got an idea, why composer would need an authentication against GitHub to update Craft, I'd be glad to hear.

  • Do you have a git repository listed in your composer.json file as a source?
    – CraftQuest
    Commented Dec 28, 2021 at 23:14
  • I do have git repositories in my composer.json. They point to BitBucket and have nothing to do with craftcms and its dependencies, but yes, I do. And I DID have GitHub repositories in my composer.json, too. Still nothing to do with CraftCMS, though.
    – S. Parton
    Commented Jan 3, 2022 at 11:02


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.