From 44d170160ab2c466b6ab069994b7f96eaaee2019 Mon Sep 17 00:00:00 2001 From: Christian Fehmer Date: Tue, 28 Jul 2026 20:10:52 +0200 Subject: [PATCH 1/2] ci: use cache for format checking (@fehmer) (#8297) - **ci: use cache for format checking (@fehmer)** - **always run format check** - **fix: prime-cache includes force-full-ci and on-failure references correct job name** --- .github/workflows/check-formatting.yml | 63 ----------------------- .github/workflows/monkey-ci.yml | 69 +++++++++++++++++++++++++- 2 files changed, 67 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/check-formatting.yml diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml deleted file mode 100644 index b28ddb8535c9..000000000000 --- a/.github/workflows/check-formatting.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Check formatting - -env: - PNPM_VERSION: "10.28.1" - NODE_VERSION: "24.11.0" - -on: - pull_request: - branches: [master] - types: [opened, reopened, synchronize, ready_for_review] - -permissions: - contents: read - -concurrency: - group: group-format-check-${{ github.ref }}-${{ github.workflow }} - cancel-in-progress: true - -jobs: - check: - if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'force-ci') || contains(github.event.pull_request.labels.*.name, 'force-full-ci') - runs-on: ubuntu-latest - - steps: - - name: Full checkout - uses: actions/checkout@v6 - - - name: Set up Node.js - uses: actions/setup-node@v6 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Setup pnpm - uses: pnpm/action-setup@v6 - with: - version: ${{ env.PNPM_VERSION }} - - - name: Install - run: pnpm install --ignore-scripts - - - name: Get changed files and write to temp - id: get-changed-files - uses: actions/github-script@v9 - with: - script: | - const changedFiles = await github.paginate( - github.rest.pulls.listFiles, - { - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number, - } - ); - const files = changedFiles.filter(file=> file.status !== "removed").map(file => file.filename); - if (files.length > 0) { - require('fs').writeFileSync('/tmp/changed-files.txt', files.join('\0')); - core.setOutput('has-files', 'true'); - } - - - name: Check formatting (changed files) - if: steps.get-changed-files.outputs.has-files == 'true' - run: | - xargs -0 pnpm oxfmt --check --no-error-on-unmatched-pattern < /tmp/changed-files.txt diff --git a/.github/workflows/monkey-ci.yml b/.github/workflows/monkey-ci.yml index 9364ff9c68cf..d9689e207a89 100644 --- a/.github/workflows/monkey-ci.yml +++ b/.github/workflows/monkey-ci.yml @@ -71,7 +71,7 @@ jobs: name: prime-cache runs-on: ubuntu-latest needs: [pre-ci] - if: needs.pre-ci.outputs.should-build-be == 'true' || needs.pre-ci.outputs.should-build-fe == 'true' || needs.pre-ci.outputs.should-build-pkg == 'true' || needs.pre-ci.outputs.assets-or-styles == 'true' || contains(github.event.pull_request.labels.*.name, 'force-full-ci') + if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'force-ci') || contains(github.event.pull_request.labels.*.name, 'force-full-ci') steps: - name: Checkout pnpm-lock uses: actions/checkout@v6 @@ -113,6 +113,71 @@ jobs: name: Install dependencies run: pnpm install + check-format: + name: check-format + needs: [prime-cache] + if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'force-ci') || contains(github.event.pull_request.labels.*.name, 'force-full-ci') + runs-on: ubuntu-latest + steps: + - name: Full checkout + uses: actions/checkout@v6 + + - name: Get changed files and write to temp + id: get-changed-files + uses: actions/github-script@v9 + with: + script: | + const changedFiles = await github.paginate( + github.rest.pulls.listFiles, + { + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: context.payload.pull_request.number, + } + ); + const files = changedFiles.filter(file=> file.status !== "removed").map(file => file.filename); + if (files.length > 0) { + require('fs').writeFileSync('/tmp/changed-files.txt', files.join('\0')); + core.setOutput('has-files', 'true'); + } + + - name: Set up Node.js + if: steps.get-changed-files.outputs.has-files == 'true' + uses: actions/setup-node@v6 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Setup pnpm + if: steps.get-changed-files.outputs.has-files == 'true' + uses: pnpm/action-setup@v6 + with: + version: ${{ env.PNPM_VERSION }} + + - name: Get pnpm store directory + if: steps.get-changed-files.outputs.has-files == 'true' + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Cache node modules + if: steps.get-changed-files.outputs.has-files == 'true' + id: cache-pnpm + uses: actions/cache@v5 + env: + cache-name: node-modules + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-${{ env.NODE_VERSION }}-build-${{ env.cache-name }}-${{ hashFiles('pnpm-lock.yaml') }} + + - name: Install dependencies + if: steps.get-changed-files.outputs.has-files == 'true' + run: pnpm install + + - name: Check formatting (changed files) + if: steps.get-changed-files.outputs.has-files == 'true' + run: | + xargs -0 pnpm oxfmt --check --no-error-on-unmatched-pattern < /tmp/changed-files.txt + ci-be: name: ci-be needs: [pre-ci, prime-cache] @@ -341,7 +406,7 @@ jobs: on-failure: name: on-failure runs-on: ubuntu-latest - needs: [ci-be, ci-fe, ci-assets, ci-pkg] + needs: [ci-be, ci-fe, ci-assets, ci-pkg, check-format] if: ${{ always() && contains(needs.*.result, 'failure') && github.ref != 'refs/heads/master' }} steps: - name: Save the PR number in an artifact From 94b97b8e19bb738d3a292127bd3eb1a8c951ae97 Mon Sep 17 00:00:00 2001 From: Miodec Date: Tue, 28 Jul 2026 19:17:00 +0100 Subject: [PATCH 2/2] chore: make sure to escape html --- .../src/ts/components/modals/QuoteSearchModal.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/ts/components/modals/QuoteSearchModal.tsx b/frontend/src/ts/components/modals/QuoteSearchModal.tsx index e2a72bacd100..5f262217d975 100644 --- a/frontend/src/ts/components/modals/QuoteSearchModal.tsx +++ b/frontend/src/ts/components/modals/QuoteSearchModal.tsx @@ -129,7 +129,9 @@ function Item(props: { class="text-text [&_.highlight]:text-main" dir="auto" // oxlint-disable-next-line solid/no-innerhtml - innerHTML={highlightMatches(props.quote.text, props.matchedTerms)} + innerHTML={Misc.escapeHTML( + highlightMatches(props.quote.text, props.matchedTerms), + )} >
@@ -137,9 +139,8 @@ function Item(props: {
@@ -153,9 +154,8 @@ function Item(props: {