CI: authenticate Composer against GitHub to avoid codeload 429s #50
Labels
No labels
app
backlog
bug
ci-cd
contribution welcome
duplicate
enhancement
good first issue
help wanted
question
testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/dishplanner#50
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
composer installin CI fails with HTTP 429 fromcodeload.github.com— GitHub rate-limits anonymous dist downloads per-IP, and the Forgejo runner's egress IP gets hard-limited (all retry attempts fail, even single downloads).Proper fix: authenticate Composer against GitHub with an OAuth token so downloads use the per-token limit instead of the per-IP anonymous limit:
GITHUB_TOKEN(Settings → Actions → Secrets)..forgejo/workflows/ci.yml, set on the install step:COMPOSER_AUTH: '{"github-oauth":{"github.com":"${{ secrets.GITHUB_TOKEN }}"}}'and revert
--prefer-sourceback to--prefer-dist.Temporary workarounds in place (no GitHub account):
composer install --prefer-source(git clone) for most packages.phpstan/phpstanbaked into the CI image via a cache-warm step indocker/build/Dockerfile.ci(it is dist-only and has no VCS source), so it avoids codeload.Both workarounds should be removed once the GitHub token is configured.