Skip to content

Commit 686f115

Browse files
authored
use common link checker (open-telemetry#321)
1 parent dc7f5fe commit 686f115

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

.github/config/lychee.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include_fragments = true
1111

1212
remap = [
1313
# workaround for https://github.com/lycheeverse/lychee/issues/1729
14-
"https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4",
14+
'https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4',
1515
]
1616

1717
exclude = [

.github/workflows/reusable-link-check.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,18 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
14+
with:
15+
fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files
1416

15-
- name: Setup mise
16-
uses: jdx/mise-action@156251fcc627ac4e26cb0f93dd47d1d4979abf24 # v3.3.0
17+
- uses: jdx/mise-action@e3d7b8d67a7958d1207f6ed871e83b1ea780e7b0 # v3.3.1
1718

18-
- name: Run link check
19-
run: mise run link-check
19+
- name: Link check - relative links (all files)
20+
if: github.event_name == 'pull_request'
21+
env:
22+
GITHUB_TOKEN: ${{ github.token }}
23+
run: mise run lint:local-links
24+
25+
- name: Link check (modified files only)
26+
env:
27+
GITHUB_TOKEN: ${{ github.token }}
28+
run: mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }} --event ${{ github.event_name }}

mise.toml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
[tools]
22
lychee = "0.20.1"
33

4-
[tasks.link-check]
5-
run = 'lychee --verbose --config .github/config/lychee.toml .'
6-
74
[settings]
85
# Only install tools explicitly defined in the [tools] section above
96
idiomatic_version_file_enable_tools = []
7+
8+
# Windows configuration for file-based tasks
9+
# Based on: https://github.com/jdx/mise/discussions/4461
10+
windows_executable_extensions = ["sh"]
11+
windows_default_file_shell_args = "bash"
12+
use_file_shell_for_executable_tasks = true
13+
14+
[tasks."lint:links"]
15+
file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/links.sh"
16+
17+
[tasks."lint:local-links"]
18+
file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/local-links.sh"
19+
20+
[tasks."lint:links-in-modified-files"]
21+
file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/links-in-modified-files.sh"

0 commit comments

Comments
 (0)