Skip to content

Commit f40cad5

Browse files
MrAliasAneurysm9
andauthored
Add markdown link check configuration and action (open-telemetry#1869)
* Add Markdown link check * Add replacement for registry URL and clean ignored * Fix config file name * Update .markdown-link.json Co-authored-by: Anthony Mirabella <[email protected]> Co-authored-by: Anthony Mirabella <[email protected]>
1 parent 9bc28f6 commit f40cad5

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

.github/workflows/markdown.yml

+17
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
id: changes
2020
run: |
2121
echo "::set-output name=md::$(git diff --name-only --diff-filter=ACMRTUXB origin/${{ github.event.pull_request.base.ref }} ${{ github.event.pull_request.head.sha }} | grep .md$ | xargs)"
22+
2223
lint:
2324
name: lint markdown files
2425
runs-on: ubuntu-latest
@@ -31,3 +32,19 @@ jobs:
3132
uses: docker://avtodev/markdown-lint:v1
3233
with:
3334
args: ${{needs.changedfiles.outputs.md}}
35+
36+
check-links:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout Repo
40+
uses: actions/checkout@v2
41+
with:
42+
fetch-depth: 0
43+
- uses: gaurav-nelson/github-action-markdown-link-check@v1
44+
with:
45+
base-branch: 'main'
46+
use-quiet-mode: 'yes'
47+
use-verbose-mode: 'yes'
48+
config-file: '.markdown-link.json'
49+
check-modified-files-only: 'yes'
50+
folder-path: ''

.markdown-link.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"ignorePatterns": [
3+
{
4+
"pattern": "^http(s)?://localhost"
5+
}
6+
],
7+
"replacementPatterns": [
8+
{
9+
"pattern": "^/registry",
10+
"replacement": "https://opentelemetry.io/registry"
11+
}
12+
],
13+
"retryOn429": true,
14+
"retryCount": 5,
15+
"fallbackRetryDelay": "30s"
16+
}

0 commit comments

Comments
 (0)