Skip to content

Commit

Permalink
Create spellcheck.yml (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
chauhang authored Jul 30, 2023
2 parents 3cc2b37 + 0d9c1a9 commit 2243b96
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: SpellCheck

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
name: Lint changed files
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

- name: Check links in all markdown files
uses: gaurav-nelson/[email protected]
with:
use-verbose-mode: 'yes'
config-file: "scripts/markdown_link_check_config.json"

- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:

files: |
**/*.py
spellcheck:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt-get install aspell aspell-en
pip install pyspelling
- name: Get changed files
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
**/*.md
- name: Check spellings
run: |
sources=""
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
sources="${sources} -S $file"
done
if [ ! "$sources" ]; then
echo "No files to spellcheck"
else
pyspelling -c $GITHUB_WORKSPACE/scripts/spellcheck_conf/spellcheck.yaml --name Markdown $sources
fi
- name: In the case of misspellings
if: ${{ failure() }}
run: |
echo "Please fix the misspellings. If you are sure about some of them, "
echo "so append those to scripts/spellcheck_conf/wordlist.txt"
3 changes: 3 additions & 0 deletions scripts/markdown_link_check_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
},
{
"pattern": "^http(s)?://localhost.*"
},
{
"pattern": "https://www.intel.com/content/www/us/en/developer/articles/news/llama2.html"
}
]
}

0 comments on commit 2243b96

Please sign in to comment.