Skip to content

Commit 86270d7

Browse files
authored
Use lychee link checker (#1022)
* Use lychee link checker * Update checkout action version to v6.0.2
1 parent b83e0c1 commit 86270d7

4 files changed

Lines changed: 64 additions & 36 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
## Fixes
2-
<!-- List the GitHub issue this PR resolves -->
3-
4-
- [#<Number>](https://github.com/Open-CMSIS-Pack/vscode-cmsis-debugger/issues/<number>)
2+
<!-- List the GitHub issue(s) this PR resolves (e.g. #123) -->
3+
- #<issue-number>
54

65
## Changes
76
<!-- List the changes this PR introduces -->

.github/lychee.toml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# For all options, see <https://lychee.cli.rs/usage/config/>
2+
3+
# Verbose program output
4+
# Accepts log level: "error", "warn", "info", "debug", "trace"
5+
verbose = "info"
6+
7+
# Interactive progress bar while checking links.
8+
# Disabled for CI usage
9+
no_progress = true
10+
cache = false
11+
12+
accept = [
13+
"200"
14+
]
15+
16+
# Maximum number of allowed redirects.
17+
max_redirects = 2
18+
19+
# Maximum number of allowed retries before a link is declared dead.
20+
max_retries = 2
21+
22+
# Only test links with the given schemes
23+
# Omit to check links with any other scheme.
24+
scheme = ["http", "https", "file"]
25+
26+
# Exclude links
27+
exclude = [
28+
# Needs cookies to be accepted
29+
'https://developer.arm.com',
30+
'https://www.segger.com'
31+
]
32+
33+
# Exclude paths from getting checked. The values are treated as regular expressions
34+
exclude_path = [
35+
"(^|[\\\\/])CHANGELOG\\.md$", # skip changelog file
36+
"\\.txt$", # skip .txt extensions
37+
"\\.html$", # skip .html extensions
38+
]

.github/workflows/markdown.yml

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,18 @@ jobs:
4545
check-links:
4646
name: Check Markdown Links
4747
runs-on: ubuntu-latest
48-
permissions:
49-
packages: read
5048
steps:
5149
- name: Harden the runner (Audit all outbound calls)
5250
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
5351
with:
5452
egress-policy: audit
5553

56-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57-
58-
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
59-
env:
60-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61-
with:
62-
node-version-file: package.json
63-
registry-url: https://npm.pkg.github.com
64-
package-manager-cache: false
65-
66-
- name: Install dependencies
67-
env:
68-
GITHUB_TOKEN: ${{ github.token }}
69-
run: npm ci
54+
- name: Checkout repository
55+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
7056

71-
# Automatically retry the link check if it fails
72-
# This helps reduce false positives in CI caused by transient errors
7357
- name: Check Links
74-
if: runner.os == 'Linux'
75-
uses: Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
58+
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
7659
with:
77-
attempt_delay: 2000
78-
attempt_limit: 3
79-
command: npm run check:links
60+
args: --config .github/lychee.toml './**/*.md'
61+
fail: true
62+
jobSummary: true

.github/workflows/nightly.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@ permissions:
1313
contents: read
1414

1515
jobs:
16+
validate-markdown-links:
17+
name: Validate Markdown Links
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Harden the runner (Audit all outbound calls)
21+
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
22+
with:
23+
egress-policy: audit
24+
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
27+
- name: Validate Links
28+
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
29+
with:
30+
args: --config .github/lychee.toml './**/*.md'
31+
fail: true
32+
jobSummary: false
33+
1634
build:
1735
if: github.repository == 'Open-CMSIS-Pack/vscode-cmsis-debugger'
1836
strategy:
@@ -84,16 +102,6 @@ jobs:
84102
if: runner.os == 'Linux'
85103
run: npm run build
86104

87-
# Automatically retry the link check if it fails
88-
# This helps reduce false positives in CI caused by transient errors
89-
- name: Check Links
90-
if: runner.os == 'Linux'
91-
uses: Wandalen/wretry.action@e68c23e6309f2871ca8ae4763e7629b9c258e1ea # v3.8.0
92-
with:
93-
attempt_delay: 2000
94-
attempt_limit: 3
95-
command: npm run check:links
96-
97105
- name: Check copyright
98106
if: runner.os == 'Linux'
99107
run: npm run copyright:check

0 commit comments

Comments
 (0)