Skip to content

Commit a7b5001

Browse files
check-links added to repo (#1559)
* check-links added * Review * Dotnet changes removed * Delete dotnet/sample-apps/aws-sdk/wrapper/SampleApps/AwsSdkSample/obj/Debug/net6.0 directory Unwanted * Undo deleted AwsSdkSample.sln
1 parent 6151af2 commit a7b5001

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/check-links.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: check-links
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.head_ref }}
9+
jobs:
10+
changedfiles:
11+
name: changed files
12+
runs-on: ubuntu-latest
13+
env:
14+
PR_HEAD: ${{ github.event.pull_request.head.sha }}
15+
outputs:
16+
md: ${{ steps.changes.outputs.md }}
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
20+
with:
21+
fetch-depth: 0
22+
- name: Get changed files
23+
id: changes
24+
run: |
25+
echo "md=$(git diff --name-only --diff-filter=ACMRTUXB $(git merge-base origin/main $PR_HEAD) $PR_HEAD | grep .md$ | xargs)" >> $GITHUB_OUTPUT
26+
27+
check-links:
28+
runs-on: ubuntu-latest
29+
needs: changedfiles
30+
if: ${{needs.changedfiles.outputs.md}}
31+
steps:
32+
- name: Checkout Repo
33+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Install markdown-link-check
38+
run: npm install
39+
40+
- name: Run markdown-link-check
41+
run: |
42+
npx --no -- markdown-link-check \
43+
--verbose \
44+
--config .github/workflows/check_links_config.json \
45+
${{needs.changedfiles.outputs.md}} \
46+
|| { echo "Check that anchor links are lowercase"; exit 1; }
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
"pattern": "https://docs.aws.amazon.com"
14+
},
15+
{
16+
"pattern": "https://console.aws.amazon.com"
17+
}
18+
],
19+
"aliveStatusCodes": [429, 200],
20+
"httpHeaders": [
21+
{
22+
"urls": ["https://docs.aws.amazon.com", "https://docs.github.com/"],
23+
"headers": {
24+
"Accept-Encoding": "zstd, br, gzip, deflate"
25+
}
26+
}
27+
]
28+
}

0 commit comments

Comments
 (0)