From 946dc8ac23e5466a572015b6d9220e4117e89b07 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Wed, 27 May 2026 09:57:50 +0200 Subject: [PATCH] fix: shell syntax error in lint-format-autofix job with paths containing parentheses When a changed file path contains parentheses (e.g. boards/(content)/_theme.tsx), GitHub Actions expands ${{ steps.changed.outputs.files }} directly into the shell script, causing bash to interpret '(' as subshell syntax and fail. Fix: write changed files to a temp file and use xargs -a to read them, completely bypassing shell interpretation of the paths. --- .github/workflows/code-quality.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 6b08b4e10..40d4ceb08 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -42,14 +42,14 @@ jobs: - name: Get changed files id: changed run: | - FILES=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx' | tr '\n' ' ') - echo "files=$FILES" >> $GITHUB_OUTPUT + git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD -- '*.ts' '*.tsx' '*.js' '*.jsx' > /tmp/changed-files + echo "count=$(wc -l < /tmp/changed-files | tr -d '[:space:]')" >> $GITHUB_OUTPUT - name: Auto-fix lint + format - if: steps.changed.outputs.files != '' + if: steps.changed.outputs.count != '0' run: | - pnpm exec oxlint --fix ${{ steps.changed.outputs.files }} || true - pnpm exec oxfmt --write ${{ steps.changed.outputs.files }} + xargs -r -a /tmp/changed-files pnpm exec oxlint --fix || true + xargs -r -a /tmp/changed-files pnpm exec oxfmt --write - name: Commit fixes uses: stefanzweifel/git-auto-commit-action@v5