fix(ci): correct bash escaping in dependency checkout step
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:
parent
bd16f7bd54
commit
3752fe7cb0
1 changed files with 15 additions and 17 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue