fix(ci): correct bash escaping in dependency checkout step
Some checks are pending
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run

The PHP variables inside php -r need \$ escaping, but shell
variables outside need bare $ for command substitution and
variable expansion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude 2026-02-23 05:19:20 +00:00
parent 5fc54516bf
commit 478e0b8009
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -26,26 +26,24 @@ jobs:
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite
coverage: pcov
- name: Checkout dependencies
- name: Checkout path dependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if grep -q '"path":' composer.json 2>/dev/null; then
for path in $(php -r "
\$d = json_decode(file_get_contents('composer.json'), true);
foreach (\$d['repositories'] ?? [] as \$r) {
if ((\$r['type'] ?? '') === 'path') echo \$r['url'] . \"\\n\";
}
"); do
dir_name=$(basename "$path")
if [ ! -d "$path" ]; then
echo "Cloning $dir_name into $path"
git clone --depth 1 \
"https://x-access-token:${GITHUB_TOKEN}@forge.lthn.ai/core/${dir_name}.git" \
"$path" || echo "Warning: Failed to clone $dir_name"
fi
done
fi
for path in $(php -r "
\$d = json_decode(file_get_contents('composer.json'), true);
foreach (\$d['repositories'] ?? [] as \$r) {
if ((\$r['type'] ?? '') === 'path') echo \$r['url'] . \"\\n\";
}
"); do
dir_name=$(basename "$path")
if [ ! -d "$path" ]; then
echo "Cloning $dir_name into $path"
git clone --depth 1 \
"https://x-access-token:${GITHUB_TOKEN}@forge.lthn.ai/core/${dir_name}.git" \
"$path" || echo "Warning: Failed to clone $dir_name"
fi
done
- name: Install dependencies
run: composer install --prefer-dist --no-interaction --no-progress