Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved link checker #1285

Merged
merged 6 commits into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading