Skip to content

Commit

Permalink
Check spelling and links
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Jan 16, 2024
1 parent 76b1ddc commit 182b7e8
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 12 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/check_links.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
name: Check links

on:
push:
pull_request:
schedule:
- cron: "0 0 16 * *"
- cron: "0 0 12 * *"

name: check-links

jobs:
check_links:

check-links:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- name: Remove folders that do not care about broken links
- name: Remove lines with false positives
run: |
rm -rf DevelopmentDesign
sed -i 's/.*check_links.yaml.*//g' README.md
sed -i 's/.*check_spelling.yaml.*//g' README.md
- uses: gaurav-nelson/github-action-markdown-link-check@v1
# If there is a valid external link that fails,
# add it to mlc_config.json
- name: External links must be checked, do not allow '0' in the 'aliveStatusCodes' of mlc_config.json
run: if [[ $(grep --regexp "[^0-9]0[^0-9]" mlc_config.json | wc --lines) == "1" ]]; then echo "FOUND"; exit 42; fi

- name: Internal links must checked, do not allow '400' in the 'aliveStatusCodes' of mlc_config.json
run: if [[ $(grep --regexp "[^0-9]400[^0-9]" mlc_config.json | wc --lines) == "1" ]]; then echo "FOUND"; exit 42; fi

#- uses: lycheeverse/lychee-action@v1.2.0
# with:
# fail: true
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
config-file: 'mlc_config.json'
7 changes: 7 additions & 0 deletions .github/workflows/check_spelling.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Check that there is correct spelling in all files
name: Check spelling

on:
Expand All @@ -18,4 +19,10 @@ jobs:
- name: Set up Git repository
uses: actions/checkout@v2

- name: Remove folders that do not care about spelling
run: |
rm -rf development_design
rm -rf projects
rm -rf feedback
- uses: igsekor/[email protected]
45 changes: 45 additions & 0 deletions .spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
matrix:
- name: markdown
dictionary:
wordlists:
- .wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.markdown:
markdown_extensions:
- markdown.extensions.extra:
- pyspelling.filters.html:
comments: false
attributes:
- alt
ignores:
- ':matches(code, pre)'
- 'code'
- 'pre'
- 'blockquote'
sources:
- '**/*.md'
default_encoding: utf-8
- name: Quarto markdown
dictionary:
wordlists:
- .wordlist.txt
output: wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.markdown:
markdown_extensions:
- markdown.extensions.extra:
- pyspelling.filters.html:
comments: false
attributes:
- alt
ignores:
- ':matches(code, pre)'
- 'code'
- 'pre'
- 'blockquote'
sources:
- '**/*.md'
default_encoding: utf-8
1 change: 1 addition & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Richel
14 changes: 14 additions & 0 deletions mlc_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"aliveStatusCodes": [200, 403, 418, 503],
"ignorePatterns": [
{
"pattern": "^morning_session/overview/$"
},
{
"pattern": "^https://bianca.uppmax.uu.se"
},
{
"pattern": "^https://rackham-gui.uppmax.uu.se"
}
]
}

0 comments on commit 182b7e8

Please sign in to comment.