Skip to content

Commit 592fa15

Browse files
authored
Use flint for link checking (#16270)
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent f7cba3b commit 592fa15

4 files changed

Lines changed: 19 additions & 16 deletions

File tree

.github/config/lychee.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ max_concurrency = 4
1010
include_fragments = true
1111

1212
remap = [
13-
# workaround for https://github.com/lycheeverse/lychee/issues/1729
14-
"https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4",
1513
"https://docs.oracle.com/(.*)#.*$ https://docs.oracle.com/$1"
1614
]
1715

1816
# excluding links to pull requests and issues is done for performance
1917
# stackexchange link fails with 403 when accessed by lychee
2018
exclude = [
21-
# workaround for https://github.com/lycheeverse/lychee/issues/1729
22-
'^https://github.com/.*#issuecomment-.*$',
2319
'^https://github.com/open-telemetry/opentelemetry-java-instrumentation/(issues|pull)/\d+$',
2420
'^http://code.google.com/p/concurrentlinkedhashmap$',
2521
'^https://softwareengineering.stackexchange.com/questions/29727.*',

.github/renovate.json5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,17 @@
352352
},
353353
],
354354
customManagers: [
355+
{
356+
// keep SHA-pinned raw.githubusercontent.com URLs in mise.toml up to date
357+
customType: 'regex',
358+
datasourceTemplate: 'github-tags',
359+
managerFilePatterns: [
360+
'/^mise\\.toml$/',
361+
],
362+
matchStrings: [
363+
'https://raw\\.githubusercontent\\.com/(?<depName>[^/]+/[^/]+)/(?<currentDigest>[a-f0-9]{40})/.*#\\s*(?<currentValue>v\\S+)',
364+
],
365+
},
355366
{
356367
customType: 'regex',
357368
datasourceTemplate: 'java-version',

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1414
with:
15-
fetch-depth: 0 # needed for merge-base used in lint:links-in-modified-files
15+
fetch-depth: 0 # needed for merge-base used in modified-files mode
1616

1717
- uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1
1818

1919
- name: Link check for pull requests
2020
if: github.event_name == 'pull_request'
2121
env:
2222
GITHUB_TOKEN: ${{ github.token }}
23-
run: |
24-
mise run lint:local-links
25-
mise run lint:links-in-modified-files --base origin/${{ github.base_ref }} --head ${{ github.event.pull_request.head.sha }}
23+
GITHUB_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
24+
PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
25+
run: mise run lint:links
2626

2727
- name: Link check for pushes and scheduled workflows
2828
if: github.event_name != 'pull_request'
2929
env:
3030
GITHUB_TOKEN: ${{ github.token }}
31-
run: mise run lint:links
31+
run: mise run lint:links --full

mise.toml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ windows_executable_extensions = ["sh"]
1212
windows_default_file_shell_args = "bash"
1313
use_file_shell_for_executable_tasks = true
1414

15+
# Pick the tasks you need from flint (https://github.com/grafana/flint)
1516
[tasks."lint:links"]
16-
file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/links.sh"
17-
18-
[tasks."lint:local-links"]
19-
file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/local-links.sh"
20-
21-
[tasks."lint:links-in-modified-files"]
22-
file = "https://raw.githubusercontent.com/open-telemetry/opentelemetry-java-contrib/refs/heads/main/.mise/tasks/lint/links-in-modified-files.sh"
17+
description = "Check for broken links in changed files + all local links"
18+
file = "https://raw.githubusercontent.com/grafana/flint/8822bdc543f28f2c7dd1f697af4df6d89768c507/tasks/lint/links.sh" # v0.7.0

0 commit comments

Comments
 (0)