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