From ea0190d4d6d9c0efe4fe8a8c70a0194bba673093 Mon Sep 17 00:00:00 2001 From: Laurence0x03 Date: Tue, 27 May 2025 11:12:56 +1000 Subject: [PATCH 1/4] Spell check always checks all files --- .github/workflows/spell_check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index 089ef96..55d46c0 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -15,4 +15,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: streetsidesoftware/cspell-action@v7 \ No newline at end of file + - uses: streetsidesoftware/cspell-action@v7 + with: + incremental_files_only: false \ No newline at end of file From c912ceb849cb18b8c8dea8471f52a2d1f834e15b Mon Sep 17 00:00:00 2001 From: Laurence0x03 Date: Tue, 27 May 2025 11:15:08 +1000 Subject: [PATCH 2/4] Apparently works with 0 permissions --- .github/workflows/spell_check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index 55d46c0..e49d11a 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -7,8 +7,8 @@ on: - main # test with no permissions -permissions: - contents: none +# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/controlling-permissions-for-github_token#defining-access-for-the-github_token-permissions +permissions: {} jobs: spellcheck: From b4681772e3d33b2c9aa7275d2b96c878f88091a2 Mon Sep 17 00:00:00 2001 From: Laurence0x03 Date: Tue, 27 May 2025 11:18:38 +1000 Subject: [PATCH 3/4] Use cspell config for action file input --- .github/workflows/spell_check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spell_check.yml b/.github/workflows/spell_check.yml index e49d11a..0335c6d 100644 --- a/.github/workflows/spell_check.yml +++ b/.github/workflows/spell_check.yml @@ -17,4 +17,5 @@ jobs: - uses: actions/checkout@v4 - uses: streetsidesoftware/cspell-action@v7 with: - incremental_files_only: false \ No newline at end of file + incremental_files_only: false + use_cspell_files: true \ No newline at end of file From 48ab1533ed832102a51cdc5cec7283013d9c2d6d Mon Sep 17 00:00:00 2001 From: Laurence0x03 Date: Tue, 27 May 2025 11:27:24 +1000 Subject: [PATCH 4/4] Readme entry for CSpell findings --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 74b5f11..b7b3297 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,20 @@ branches: - main ``` + +### CSpell GHA + +Apparently this GHA [doesn't require any permissions to function](https://github.com/laurencee/GithubActionTesting/pull/17/files#diff-616593396de2fd1a651a07cd6e58919c62943ce8b34d237b85adbdd4ce2438d1L11) despite what [this issue indicated](https://github.com/streetsidesoftware/cspell-action/issues/712). + +For my purposes, it was important to set the following on the CSpell github action if you want it to check your whole repo everytime. + +This is particularly useful if you have an existing larger repo and want your initial main builds to highlight issues that you can fix later. + +The other surprise was you must set the `use_cspell_files` field or your cspell files input will be ignored. + +```yaml + - uses: streetsidesoftware/cspell-action@v7 + with: + incremental_files_only: false + use_cspell_files: true +```