Repository navigation
fix: pass the GitHub token as a build secret, resolve static-php-cli tag without GitHub API - #14
Merged
Merged
Conversation
…tag without GitHub API (#14) ## The Issue - Related to ddev/ddev-nvm#6 - Follow-up to ddev/ddev-sqlsrv#57 The latest static-php-cli tag came from `api.github.com`, which allows 60 unauthenticated requests per hour per IP. The token was passed as a build arg, which is recorded in `docker history` and in `.ddev/.ddev-docker-compose-full.yaml`. ## How This PR Solves The Issue - Read the tag from the `https://github.com/crazywhalecc/static-php-cli/releases/latest` redirect, which is not API rate-limited, and check that it looks like a version - Remove the `GITHUB_TOKEN` build arg and mount the `github_token` build secret that DDEV provides since ddev/ddev#8948 - Export the secret as `GITHUB_TOKEN` for `bin/spc download`. `composer update` doesn't need it, because Composer downloads from GitHub don't count against the API rate limit ## Manual Testing Instructions ```bash ddev utility download-ddev --pr 8948 export PATH="$HOME/tmp/ddev-download-ddev/pr-8948:$PATH" ddev config --project-type=php ddev dotenv set .ddev/.env.php-patch-build --static-php-version=8.3.19 ddev add-on get https://github.com/rfay/ddev-php-patch-build/tarball/refs/pull/14/head ddev restart ddev php -v # A bogus token must reach static-php-cli and fail the build: DDEV_GITHUB_TOKEN=ghp_bogus ddev utility rebuild # Expect "using bearer github token" followed by "curl: (22) The requested URL returned error: 401" ``` ## Automated Testing Overview No new tests. The `HEAD` job passes the action's token through the secret. The `stable` job builds without a token until ddev/ddev#8948 is in a DDEV release. ## Release/Deployment Notes With DDEV v1.25.4 and older, the token is no longer passed to the build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Issue
ddev restartddev/ddev-nvm#6The latest static-php-cli tag came from
api.github.com, which allows 60 unauthenticated requests per hour per IP. The token was passed as a build arg, which is recorded indocker historyand in.ddev/.ddev-docker-compose-full.yaml.How This PR Solves The Issue
https://github.com/crazywhalecc/static-php-cli/releases/latestredirect, which is not API rate-limited, and check that it looks like a versionGITHUB_TOKENbuild arg and mount thegithub_tokenbuild secret that DDEV provides since feat: pass GitHub token to web builds as a secret, document PIE, fixes #7929, fixes #8549 (#8948) [skip ci] ddev/ddev#8948GITHUB_TOKENforbin/spc download.composer updatedoesn't need it, because Composer downloads from GitHub don't count against the API rate limitManual Testing Instructions
Automated Testing Overview
No new tests. The
HEADjob passes the action's token through the secret. Thestablejob builds without a token until ddev/ddev#8948 is in a DDEV release.Release/Deployment Notes
With DDEV v1.25.4 and older, the token is no longer passed to the build.