Skip to content

Commit 50f378c

Browse files
committed
Added tip on checking only changed files
1 parent 9acfe25 commit 50f378c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ This action uses [PySpelling][pyspelling] to check spelling in source files in t
3939
- [Specify Code Not To Have Spelling Checked](#specify-code-not-to-have-spelling-checked)
4040
- [Getting Your Action Updated Automatically](#getting-your-action-updated-automatically)
4141
- [Slimming Your Wordlist By Ignoring Case](#slimming-your-wordlist-by-ignoring-case)
42+
- [Check only the changed files](#check-only-the-changed-files)
4243
- [Diagnostics](#diagnostics)
4344
- [Diagnostic text: `!!!Spelling check failed!!!`](#diagnostic-text-spelling-check-failed)
4445
- [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)
@@ -659,6 +660,32 @@ $ rm temp-wordlist.txt
659660

660661
And you should be good to go.
661662

663+
### Check only the changed files
664+
665+
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.
666+
667+
Your workflow could look something like this:
668+
669+
```yaml
670+
- name: Get all changed markdown files
671+
uses: tj-actions/changed-files@v45
672+
id: changed_files
673+
with:
674+
files: |
675+
**.md
676+
677+
- name: Run Spellcheck
678+
id: spellcheck
679+
uses: rojopolis/spellcheck-github-actions@v0
680+
with:
681+
task_name: Markdown
682+
source_files: ${{ steps.changed_files.outputs.all_changed_files }}
683+
```
684+
685+
Lifted from: [jonabsn/TIL](https://jonasbn.github.io/til/).
686+
687+
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.
688+
662689
## Diagnostics
663690

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

0 commit comments

Comments
 (0)