From 478e0b80095e9c118c04e80224c0cfe05232dad7 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Feb 2026 05:19:20 +0000 Subject: [PATCH] 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 --- .forgejo/workflows/ci.yml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 15c60e0..fb74cf6 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -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