From 8ea1259943d8f0b02f595fcc4e1195d9d3c3ee81 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Wed, 10 Sep 2025 19:04:54 -0400 Subject: [PATCH] Add GitHub workflow for MDX format checking and fix parsing error (#10924) Co-authored-by: openhands --- .github/workflows/mdx-lint.yml | 70 +++++++++++++++++++++++++++++ docs/usage/architecture/runtime.mdx | 2 +- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/mdx-lint.yml diff --git a/.github/workflows/mdx-lint.yml b/.github/workflows/mdx-lint.yml new file mode 100644 index 0000000000..34cd0b6a18 --- /dev/null +++ b/.github/workflows/mdx-lint.yml @@ -0,0 +1,70 @@ +# Workflow that checks MDX format in docs/ folder +name: MDX Lint + +# Run on pushes to main and on pull requests that modify docs/ files +on: + push: + branches: + - main + paths: + - 'docs/**/*.mdx' + pull_request: + paths: + - 'docs/**/*.mdx' + +# If triggered by a PR, it will be in the same group. However, each commit on main will be in its own unique group +concurrency: + group: ${{ github.workflow }}-${{ (github.head_ref && github.ref) || github.run_id }} + cancel-in-progress: true + +jobs: + mdx-lint: + name: Lint MDX files + runs-on: blacksmith-4vcpu-ubuntu-2204 + steps: + - uses: actions/checkout@v4 + + - name: Install Node.js 22 + uses: useblacksmith/setup-node@v5 + with: + node-version: 22 + + - name: Install MDX dependencies + run: | + npm install @mdx-js/mdx@3 glob@10 + + - name: Validate MDX files + run: | + node -e " + const {compile} = require('@mdx-js/mdx'); + const fs = require('fs'); + const path = require('path'); + const glob = require('glob'); + + async function validateMDXFiles() { + const files = glob.sync('docs/**/*.mdx'); + console.log('Found', files.length, 'MDX files to validate'); + + let hasErrors = false; + + for (const file of files) { + try { + const content = fs.readFileSync(file, 'utf8'); + await compile(content); + console.log('āœ… MDX parsing successful for', file); + } catch (err) { + console.error('āŒ MDX parsing failed for', file, ':', err.message); + hasErrors = true; + } + } + + if (hasErrors) { + console.error('\\nāŒ Some MDX files have parsing errors. Please fix them before merging.'); + process.exit(1); + } else { + console.log('\\nāœ… All MDX files are valid!'); + } + } + + validateMDXFiles(); + " diff --git a/docs/usage/architecture/runtime.mdx b/docs/usage/architecture/runtime.mdx index 06164dcef1..7e6666c006 100644 --- a/docs/usage/architecture/runtime.mdx +++ b/docs/usage/architecture/runtime.mdx @@ -124,7 +124,7 @@ This tagging approach allows OpenHands to efficiently manage both development an OpenHands supports both bind mounts and Docker named volumes in SandboxConfig.volumes: - Bind mount: "/abs/host/path:/container/path[:mode]" -- Named volume: "volume::/container/path[:mode]" or any non-absolute host spec treated as a named volume +- Named volume: "volume:``:/container/path[:mode]" or any non-absolute host spec treated as a named volume Overlay mode (copy-on-write layer) is supported for bind mounts by appending ":overlay" to the mode (e.g., ":ro,overlay"). To enable overlay COW, set SANDBOX_VOLUME_OVERLAYS to a writable host directory; per-container upper/work dirs are created under it. If SANDBOX_VOLUME_OVERLAYS is unset, overlay mounts are skipped.