From daa85198451e65297e892332d5de2fc6c4ed26e4 Mon Sep 17 00:00:00 2001 From: Stefan Pejcic Date: Sat, 30 Nov 2024 00:03:52 +0100 Subject: [PATCH] Create spellcheck_docs.yml --- .github/workflows/spellcheck_docs.yml | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/spellcheck_docs.yml diff --git a/.github/workflows/spellcheck_docs.yml b/.github/workflows/spellcheck_docs.yml new file mode 100644 index 00000000..0a62329f --- /dev/null +++ b/.github/workflows/spellcheck_docs.yml @@ -0,0 +1,45 @@ +name: Spell Check + +on: + pull_request: + paths: + - 'website/**/*.md' + - 'website/**/*.mdx' + + workflow_dispatch: # Allow manual triggering of the workflow + inputs: + directory: + description: 'Directory to check' + required: false + default: 'website' + +jobs: + spell-check: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '16' + + - name: Install cspell + run: npm install -g cspell + + - name: Run cspell + run: | + if [ -n "${{ github.event.inputs.directory }}" ]; then + cspell "${{ github.event.inputs.directory }}/**/*.md" "${{ github.event.inputs.directory }}/**/*.mdx" + else + cspell "website/**/*.md" "website/**/*.mdx" + fi + + - name: Upload Spell Check Report + if: failure() + uses: actions/upload-artifact@v3 + with: + name: spell-check-report + path: report.txt