spellcheck-github-actions icon indicating copy to clipboard operation
spellcheck-github-actions copied to clipboard

Verification Scope Restriction

Open daelynum opened this issue 2 years ago • 3 comments

The spelling verification reviews all repository files, wasting time on unchanged files. Is it possible to limit checks to files in a specific pull request, focusing only on new or modified content?

Adding a "changed_only: true" flag could be a viable solution to this issue.

daelynum avatar Sep 10 '23 18:09 daelynum

Hi @daelynum

This sound like a good suggestion, I will dig into a possible solution.

jonasbn avatar Sep 11 '23 08:09 jonasbn

Hi @daelynum

I have attempted with a configuration using the action:

  • https://github.com/marketplace/actions/changed-files

This is the example/proof of concept and it seems to be working, it might require some tweaks and it will require some additional documentation updates.

name: Spellcheck Action
on: push

jobs:
  build:
    name: Spellcheck
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - uses: tj-actions/changed-files@v39
      id: changed_files

    - name: Run Spellcheck
      id: spellcheck
      uses: rojopolis/[email protected]
      with:
        task_name: Markdown
        source_files: ${{ steps.changed_files.outputs.all_changed_files }}
        output_file: spellcheck-output.txt

    - uses: actions/upload-artifact@v3
      if: '!cancelled()'
      with:
        name: Spellcheck Output
        path: spellcheck-output.txt

REF: https://github.com/jonasbn/til/blob/master/.github/workflows/spellcheck.yml

And you can see an example run here:

  • https://github.com/jonasbn/til/actions/runs/6436376804/job/17479604342

Let me know what think.

jonasbn avatar Oct 06 '23 21:10 jonasbn

Hi @jonasbn, sorry for the long return with the answer. The action works great! I appreciate your help.

daelynum avatar Dec 18 '23 15:12 daelynum