spellcheck.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: SpellCheck
  2. on:
  3. push:
  4. branches:
  5. - main
  6. pull_request:
  7. branches:
  8. - main
  9. jobs:
  10. build:
  11. runs-on: ubuntu-20.04
  12. name: Lint changed files
  13. steps:
  14. - uses: actions/checkout@v3
  15. with:
  16. fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
  17. - name: Check links in all markdown files
  18. uses: gaurav-nelson/github-action-markdown-link-check@1.0.13
  19. with:
  20. use-verbose-mode: 'yes'
  21. config-file: "scripts/markdown_link_check_config.json"
  22. - name: Get changed files
  23. id: changed-files
  24. uses: tj-actions/changed-files@v29.0.4
  25. with:
  26. files: |
  27. **/*.py
  28. spellcheck:
  29. runs-on: ubuntu-20.04
  30. steps:
  31. - uses: actions/checkout@v3
  32. - name: Install dependencies
  33. run: |
  34. sudo apt-get install aspell aspell-en
  35. pip install pyspelling
  36. - name: Get changed files
  37. id: changed-files
  38. uses: tj-actions/changed-files@v29.0.4
  39. with:
  40. files: |
  41. **/*.md
  42. - name: Check spellings
  43. run: |
  44. sources=""
  45. for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
  46. sources="${sources} -S $file"
  47. done
  48. if [ ! "$sources" ]; then
  49. echo "No files to spellcheck"
  50. else
  51. pyspelling -c $GITHUB_WORKSPACE/scripts/spellcheck_conf/spellcheck.yaml --name Markdown $sources
  52. fi
  53. - name: In the case of misspellings
  54. if: ${{ failure() }}
  55. run: |
  56. echo "Please fix the misspellings. If you are sure about some of them, "
  57. echo "so append those to scripts/spellcheck_conf/wordlist.txt"