Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions .github/workflows/check-formatting.yml

This file was deleted.

69 changes: 67 additions & 2 deletions .github/workflows/monkey-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/ts/components/modals/QuoteSearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,18 @@ 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),
)}
></div>
<div class="grid grid-cols-2 gap-2 sm:grid-cols-[1fr_1fr_3fr]">
<div class="text-xs text-sub">
<div class="opacity-50">id</div>
<span
class="[&_.highlight]:text-main"
// oxlint-disable-next-line solid/no-innerhtml
innerHTML={highlightMatches(
props.quote.id.toString(),
props.matchedTerms,
innerHTML={Misc.escapeHTML(
highlightMatches(props.quote.id.toString(), props.matchedTerms),
)}
></span>
</div>
Expand All @@ -153,9 +154,8 @@ function Item(props: {
<span
class="[&_.highlight]:text-main"
// oxlint-disable-next-line solid/no-innerhtml
innerHTML={highlightMatches(
props.quote.source,
props.matchedTerms,
innerHTML={Misc.escapeHTML(
highlightMatches(props.quote.source, props.matchedTerms),
)}
></span>
</div>
Expand Down
Loading