Skip to content

Commit bbf3bce

Browse files
ondrejmirtesclaude
andcommitted
Isolate the pinned composer from setup-php's composer auth
The ZTS compile legs failed intermittently: on runner (non-container) legs, setup-php seeds ~/.composer/auth.json with the workflow's GitHub token (conditionally — it probes api.github.com first, hence the flakiness), and the checksum-pinned composer 2.9.2 then throws at startup ("Your github oauth token for github.com contains invalid characters"). Everything these legs install comes from packagist dists, so run the pinned composer with an isolated COMPOSER_HOME instead of inheriting the ambient auth. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013j6ePxd1BobZkr8YVLnNet
1 parent 5e3c6b9 commit bbf3bce

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

.github/workflows/phar.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,15 +344,19 @@ jobs:
344344
- uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # v4.0.0
345345
if: matrix.target.family == 'macos'
346346

347-
- name: "Install Composer dependencies (containers)"
347+
- name: "Install Composer dependencies (pinned composer)"
348348
if: matrix.target.family != 'macos'
349349
# checksum-pinned composer, run under the matrix PHP so platform
350350
# requirements are validated against the interpreter the tests below
351-
# run on
351+
# run on. COMPOSER_HOME is isolated: on the runner (ZTS) legs,
352+
# setup-php seeds ~/.composer/auth.json with the workflow's GitHub
353+
# token, which this pinned composer rejects at startup ("github oauth
354+
# token contains invalid characters") — everything here comes from
355+
# packagist dists, no auth needed.
352356
run: |
353357
curl -fsSLo composer.phar "https://getcomposer.org/download/$COMPOSER_VERSION/composer.phar"
354358
echo "$COMPOSER_PHAR_SHA256 composer.phar" | sha256sum -c -
355-
php composer.phar install --no-interaction --no-progress
359+
COMPOSER_HOME="$(mktemp -d)" php composer.phar install --no-interaction --no-progress
356360
rm composer.phar
357361
358362
- name: "Smoke test (differential: native vs PHP implementations)"

0 commit comments

Comments
 (0)