File tree Expand file tree Collapse file tree 2 files changed +66
-0
lines changed
Expand file tree Collapse file tree 2 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 1+ name : check-links
2+ on :
3+ push :
4+ branches : [ main ]
5+ paths :
6+ - ' **/*.md'
7+ - ' **/*.rst'
8+ - ' .github/workflows/check-links.yml'
9+ - ' .github/workflows/check_links_config.json'
10+ pull_request :
11+ paths :
12+ - ' **/*.md'
13+ - ' **/*.rst'
14+ - ' .github/workflows/check-links.yml'
15+ - ' .github/workflows/check_links_config.json'
16+
17+ permissions :
18+ contents : read
19+
20+ concurrency :
21+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
22+ cancel-in-progress : true
23+
24+ jobs :
25+ check-links :
26+ runs-on : ubuntu-latest
27+ if : ${{ github.actor != 'dependabot[bot]' && github.actor != 'otelbot[bot]' }}
28+ timeout-minutes : 15
29+ steps :
30+ - name : Checkout Repo
31+ uses : actions/checkout@v6
32+
33+ - name : Get changed markdown files
34+ id : changed-files
35+ uses : tj-actions/changed-files@v46
36+ with :
37+ files : |
38+ **/*.md
39+ **/*.rst
40+
41+ - name : Install markdown-link-check
42+ if : steps.changed-files.outputs.any_changed == 'true'
43+ run : npm install -g markdown-link-check@v3.12.2
44+
45+ - name : Run markdown-link-check
46+ if : steps.changed-files.outputs.any_changed == 'true'
47+ run : |
48+ markdown-link-check \
49+ --verbose \
50+ --config .github/workflows/check_links_config.json \
51+ ${{ steps.changed-files.outputs.all_changed_files }} \
52+ || { echo "Check that anchor links are lowercase"; exit 1; }
Original file line number Diff line number Diff line change 1+ {
2+ "ignorePatterns" : [
3+ {
4+ "pattern" : " http(s)?://\\ d+\\ .\\ d+\\ .\\ d+\\ .\\ d+"
5+ },
6+ {
7+ "pattern" : " http(s)?://localhost"
8+ },
9+ {
10+ "pattern" : " http(s)?://example.com"
11+ }
12+ ],
13+ "aliveStatusCodes" : [429 , 200 ]
14+ }
You can’t perform that action at this time.
0 commit comments