Skip to content

Commit

Permalink
Update readme with usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jashapiro committed Mar 7, 2024
1 parent a92dc81 commit ca4220a
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,51 @@
# spellcheck

This repository contains a Docker image with the [R `spelling` package](https://cran.r-project.org/web/packages/spelling/index.html) installed.
The role of this repository is to facilitate spell checking actions across `AlexsLemonade` repositories.
This repository contains a GitHub action to run the [R `spelling` package](https://cran.r-project.org/web/packages/spelling/index.html).
The role of this action is to facilitate spell checking actions across `AlexsLemonade` repositories.

speeling
Currently the action will only spell check text in Rmd and md files

## Usage

To use this action, create a `.github/workflows/spellcheck.yml` file in your repository with the following contents (modified to fit your exact needs):

```yaml
name: Check Spelling
on:
pull_request:
branches:
- main

jobs:
spell-check:
runs-on: ubuntu-latest
name: Spell check files
steps:

- name: Checkout
uses: actions/checkout@v4

- name: Spell check action
uses: alexslemonade/spellcheck
id: spell
with:
dictionary: components/dictionary.txt

- name: Upload spell check errors
uses: actions/upload-artifact@v2
with:
name: spell_check_errors
path: spell_check_errors.tsv

- name: Fail if there are spelling errors
if: steps.spell.outputs.error_count > 0
run: |
echo "There were ${{ steps.spell.outputs.error_count }} errors"
exit 1
```
Note that the `dictionary` input to the spell check step is optional and defaults to `components/dictionary.txt`.
If you want to use a different dictionary, you can specify the path to the dictionary file in your repository.

You can also specify specific files to spell check using the `files` input to the `alexslemonade/spellcheck` step.
Globs should work as expected.

0 comments on commit ca4220a

Please sign in to comment.