streetsidesoftware / cspell-action

GitHub Action: Check Spelling
MIT License
81 stars 9 forks source link

Hidden folders are not ignored when the the working directory is not the root #750

Closed ValentinVignal closed 2 years ago

ValentinVignal commented 2 years ago

I have a project like this

.github/
  |- workflows/
  |    |- cspell_workflow.yaml
packages/
  |- .hidden/
  |    |- text.txt
  |- cspell.json
  |- text.txt

With packages/cspell.json:

{
  "ignorePaths": [
    ".hidden/text.txt"
  ],
  "words": [
    "ignoredword"
  ]
}

And .github/workflows/cspell_workflow.yaml:

name: cSpell
on: [pull_request]
jobs:
  cspell:
    runs-on: ubuntu-latest
    name: cspell
    defaults:
      run:
        working-directory: packages # The entire project and configuration files are in the folder "packages".
    steps:
      - uses: actions/checkout@v3
      - name: cspell
        uses: streetsidesoftware/cspell-action@v2

When the job cspell runs, it doesn't ignore the .hidden folder as specified in the packages/cspell.json.

You can check the run https://github.com/ValentinVignal/examples/runs/6671863347?check_suite_focus=true :

You can also check the PR https://github.com/ValentinVignal/examples/pull/1 where I made several tries and its branch: https://github.com/ValentinVignal/examples/tree/cspell/nested-configuration

Jason3S commented 2 years ago

@ValentinVignal,

Thank you for the detailed report.

One thing:

Please try either of the following:

name: cSpell
on: [pull_request]
jobs:
  cspell:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: cspell
        uses: streetsidesoftware/cspell-action@v3
        with:
          files: "packages/**"
          config: "packages/cspell.json"
name: cSpell
on: [pull_request]
jobs:
  cspell:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: cspell
        uses: streetsidesoftware/cspell-action@v3
        with:
          root: "packages"