Skip to content

Commit

Permalink
Improved link checker (#1285)
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt authored Apr 16, 2024
1 parent 2bda868 commit 5555638
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Markdown Links
name: Check hyperlinks

on:
push:
Expand All @@ -9,30 +9,23 @@ on:
- main

jobs:
check-links:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Markdown Link Checker
run: npm install -g markdown-link-check
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Create config for markdown link checker
run: |
echo '{
"projectBaseUrl":"${{ github.workspace }}",
"ignorePatterns": [
{
"pattern": "^#"
},
{
"pattern": "^https://falconllm.tii.ae"
}
]
}' > $GITHUB_WORKSPACE/md_checker_config.json
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-check-links
- name: Find Markdown Files and Check Links
run: |
find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check -c $GITHUB_WORKSPACE/md_checker_config.json
- name: Check links
run: |
pytest --check-links README.md --check-links-ignore "https://stability.ai/blog/stablecode-llm-generative-ai-coding"
pytest --check-links tutorials --check-links-ignore "https://stability.ai/blog/stablecode-llm-generative-ai-coding"

0 comments on commit 5555638

Please sign in to comment.