-
Notifications
You must be signed in to change notification settings - Fork 855
49 lines (43 loc) · 1.38 KB
/
check-links.yml
File metadata and controls
49 lines (43 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: check-links
on:
push:
branches: [ main ]
paths:
- '**/*.md'
- '.github/workflows/check-links.yml'
- '.github/workflows/check_links_config.json'
pull_request:
paths:
- '**/*.md'
- '.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
- 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; }