rojopolis / spellcheck-github-actions

Spell check action
MIT License
132 stars 38 forks source link

Ignoring paths is not supported in source_files #213

Open carusooo opened 1 week ago

carusooo commented 1 week ago

I'm having issues with configuring spellcheck to ignore file paths when passed in via the source_files argument

From the documentation here and in PySpelling, it looks like this should be all that's required.

  sources:
  - '**/*.md*|!docs/api/**'`

This is how the action is invoked

jobs:
  spellcheck:
    name: Spellcheck
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4.1.0
      name: Checkout
    - id: changed_files
      name: Changed Files
      uses: tj-actions/changed-files@v45
      with:
        files: |
           **.mdx
    - name: List all changed files
      env:
        ALL_CHANGED_FILES: ${{ steps.changed_files.outputs.all_changed_files }}
      run: |
        for file in ${ALL_CHANGED_FILES}; do
        echo "$file was changed"
        done
    - uses: rojopolis/spellcheck-github-actions@0.41.0
      name: Spellcheck

      if: ${{ steps.changed_files.outputs.all_changed_files }}
      with:
        config_path: spellcheck.yaml
        source_files: ${{ steps.changed_files.outputs.all_changed_files }}
        task_name: Markdown

I suspect this is working as intended, wanted to confirm. I think I'll need to filter out the changed files in the github action

jonasbn commented 6 days ago

hi @carusooo

Is this a public repository? if so then please provide a link

carusooo commented 5 days ago

It is a public repo, here's the spellcheck.yaml file. I ended up adding the filter to the changed file detection workflow step, since I think this action is basically connecting to the PySpelling CLI and passing in the files there.

Overall I think I need to revise my approach to spellcheck the built HTML files since mdx files aren't well handled by PySpelling.