Skip to content
Merged
Show file tree
Hide file tree
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
52 changes: 52 additions & 0 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: check-links
on:
push:
branches: [ main ]
paths:
- '**/*.md'
- '**/*.rst'
- '.github/workflows/check-links.yml'
- '.github/workflows/check_links_config.json'
pull_request:
paths:
- '**/*.md'
Comment thread
apatniv marked this conversation as resolved.
- '**/*.rst'
- '.github/workflows/check-links.yml'
- '.github/workflows/check_links_config.json'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true

jobs:
check-links:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'otelbot[bot]' }}
timeout-minutes: 15
steps:
- name: Checkout Repo
uses: actions/checkout@v6

- name: Get changed markdown files
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
**/*.md
**/*.rst

- name: Install markdown-link-check
if: steps.changed-files.outputs.any_changed == 'true'
run: npm install -g markdown-link-check@v3.12.2

- name: Run markdown-link-check
if: steps.changed-files.outputs.any_changed == 'true'
run: |
markdown-link-check \
--verbose \
--config .github/workflows/check_links_config.json \
${{ steps.changed-files.outputs.all_changed_files }} \
|| { echo "Check that anchor links are lowercase"; exit 1; }
14 changes: 14 additions & 0 deletions .github/workflows/check_links_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"ignorePatterns": [
{
"pattern": "http(s)?://\\d+\\.\\d+\\.\\d+\\.\\d+"
},
{
"pattern": "http(s)?://localhost"
},
{
"pattern": "http(s)?://example.com"
}
],
"aliveStatusCodes": [429, 200]
}
Loading