Skip to content

Commit

Permalink
Added tip on checking only changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasbn committed Oct 4, 2024
1 parent 9acfe25 commit 50f378c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This action uses [PySpelling][pyspelling] to check spelling in source files in t
- [Specify Code Not To Have Spelling Checked](#specify-code-not-to-have-spelling-checked)
- [Getting Your Action Updated Automatically](#getting-your-action-updated-automatically)
- [Slimming Your Wordlist By Ignoring Case](#slimming-your-wordlist-by-ignoring-case)
- [Check only the changed files](#check-only-the-changed-files)
- [Diagnostics](#diagnostics)
- [Diagnostic text: `!!!Spelling check failed!!!`](#diagnostic-text-spelling-check-failed)
- [Diagnostic text: `RuntimeError: None of the source targets from the configuration match any files:`](#diagnostic-text-runtimeerror-none-of-the-source-targets-from-the-configuration-match-any-files)
Expand Down Expand Up @@ -659,6 +660,32 @@ $ rm temp-wordlist.txt

And you should be good to go.

### Check only the changed files

The marvellous GitHub Action: [tj-actions/changed-files](https://github.com/tj-actions/changed-files) can be used to check only the files changed in a pull request.

Your workflow could look something like this:

```yaml
- name: Get all changed markdown files
uses: tj-actions/changed-files@v45
id: changed_files
with:
files: |
**.md
- name: Run Spellcheck
id: spellcheck
uses: rojopolis/spellcheck-github-actions@v0
with:
task_name: Markdown
source_files: ${{ steps.changed_files.outputs.all_changed_files }}
```

Lifted from: [jonabsn/TIL](https://jonasbn.github.io/til/).

This can be very use for very large repositories, where you only want to check the files changed in a pull request, so you can focus on the changes and do not have to wait so long for the action to complete.

## Diagnostics

This is a list of common diagnostics, which can be emitted by the action and it's tools.
Expand Down

0 comments on commit 50f378c

Please sign in to comment.