Update MonthlyLinkCheck.yml #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | |
#here | |
- 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 | |
#here | |
- name: What to do if this action fails | |
if: ${{ failure() }} | |
run: | | |
echo "You need to lint your code with pre-commit" | |
echo "pip install pre-commit" | |
echo "cd serve/" | |
echo "pre-commit install" | |
echo "pre-commit will lint your code for you, so git add and commit those new changes and this check should become green" | |
echo "If you've already pushed some files remotely then run git diff --name-only main | xargs pre-commit run --files" | |
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" |