diff --git a/.github/actions/spelling/.spellcheck.yml b/.github/actions/spelling/.spellcheck.yml new file mode 100644 index 000000000..9b739cbb4 --- /dev/null +++ b/.github/actions/spelling/.spellcheck.yml @@ -0,0 +1,32 @@ +matrix: + - name: Markdown + sources: + - "src/routes/**/*.mdx" + - "README.md" + - "WRITING.md" + - "CONTRIBUTING.md" + default_encoding: utf-8 + aspell: + lang: en + dictionary: + wordlists: + - ./.github/actions/spelling/allow.txt + encoding: utf-8 + pipeline: + - pyspelling.filters.markdown: + markdown_extensions: + - pymdownx.superfences + - pyspelling.filters.html: + comments: false + ignores: + - code + - pre + +wordlists: + - ./.github/actions/spelling/allow.txt + +allow_patterns: + - ./.github/actions/spelling/patterns.txt + +forbidden: + - .github/actions/spelling/forbidden.txt diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index e69f4577d..558422565 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -1,4 +1,4 @@ -name: Check Spelling +name: Spellcheck on: push: @@ -7,91 +7,33 @@ on: paths: - "**/routes/**" - "**.mdx" - pull_request_target: + pull_request: branches: - "**" paths: - "**/routes/**" - "**.mdx" - types: - - "opened" - - "reopened" - - "synchronize" - issue_comment: - types: - - "created" - schedule: - - cron: "0 12 * * *" -jobs: - spelling: - - name: Check Spelling - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: read - actions: read - security-events: write - outputs: - followup: ${{ steps.spelling.outputs.followup }} - if: ${{ github.event_name == 'pull_request' || github.event_name == 'push'}} - concurrency: - group: spelling-${{ github.event.pull_request.number || github.ref }} - steps: - - name: check-spelling - id: spelling - uses: check-spelling/check-spelling@main - with: - suppress_push_for_open_pull_request: ${{ github.actor != 'dependabot[bot]' && 1 }} - checkout: true - check_file_names: 0 - spell_check_this: check-spelling/spell-check-this@main - use_magic_file: 1 - report-timing: 1 - warnings: bad-regex,deprecated-feature,large-file,limited-references,noisy-file,non-alpha-in-dictionary,token-is-substring,whitespace-in-dictionary,unsupported-configuration,no-files-to-check - output: sarif - use_sarif: ${{ (!github.event.pull_request || (github.event.pull_request.head.repo.full_name == github.repository)) && 1 }} - extra_dictionary_limit: 20 - extra_dictionaries: cspell:software-terms/dict/softwareTerms.txt - sarif_file: results.sarif - - name: Upload SARIF to GitHub Code Scanning - uses: github/codeql-action/upload-sarif@v3 - with: - sarif_file: results.sarif +permissions: + contents: read - comment-push: - name: Report (Push) +jobs: + spellcheck: + name: GitHub Spellcheck runs-on: ubuntu-latest - needs: spelling - permissions: - contents: write - if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push' steps: - - name: comment - uses: check-spelling/check-spelling@main + - name: Check out code + uses: actions/checkout@v3 + - name: Check Changed Files + uses: tj-actions/changed-files@v45 + id: changed_files with: - checkout: true - spell_check_this: check-spelling/spell-check-this@main - task: ${{ needs.spelling.outputs.followup }} - - update: - name: Update PR - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-latest - if: ${{ - github.event_name == 'issue_comment' && - github.event.issue.pull_request && - contains(github.event.comment.body, '@check-spelling-bot apply') - }} - concurrency: - group: spelling-update-${{ github.event.issue.number }} - cancel-in-progress: false - steps: - - name: apply spelling updates - uses: check-spelling/check-spelling@main + files: | + src/routes/**/*.mdx + - name: Run Spellcheck + id: spellcheck + uses: rojopolis/spellcheck-github-actions@v0 with: - checkout: true - spell_check_this: check-spelling/spell-check-this@main - task: ${{ needs.spelling.outputs.followup }} + config_path: ./.github/actions/spelling/spellcheck.yml + task_name: Markdown + source_files: ${{ steps.changed_files.outputs.all_changed_files }}