Skip to content

Commit

Permalink
[chore] use lychee for link checking (#828)
Browse files Browse the repository at this point in the history
This is the same tool as is used in the collector and collector-contrib repositories.

Signed-off-by: Alex Boten <[email protected]>
  • Loading branch information
codeboten authored Feb 12, 2025
1 parent b89bc58 commit 82cca5e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 37 deletions.
11 changes: 11 additions & 0 deletions .github/lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
include-fragments = true

accept = ["200..=299", "429"]

exclude = [
"^http(s)?://localhost",
"^http(s)?://example.com"
]

# better to be safe and avoid failures
max-retries = 6
18 changes: 6 additions & 12 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ env:
# Make sure to exit early if cache segment download times out after 2 minutes.
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
# renovate: datasource=github-releases depName=tcort/markdown-link-check
MD_LINK_CHECK_VERSION: "3.12.2"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
Expand Down Expand Up @@ -84,14 +82,10 @@ jobs:
- name: Render .chloggen changelog entries
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
run: make chlog-preview > changelog_preview.md
- name: Install markdown-link-check
- name: Link Checker
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
run: npm install -g markdown-link-check@${{ env.MD_LINK_CHECK_VERSION }}
- name: Run markdown-link-check
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') && !contains(github.event.pull_request.labels.*.name, 'Skip Changelog') && !contains(github.event.pull_request.title, '[chore]')}}
run: |
markdown-link-check \
--verbose \
--config .github/workflows/check_links_config.json \
changelog_preview.md \
|| { echo "Check that anchor links are lowercase"; exit 1; }
id: lychee
uses: lycheeverse/lychee-action@f613c4a64e50d792e0b31ec34bbcbba12263c6a6
with:
args: "--verbose --no-progress ./changelog_preview.md --config .github/lychee.toml"
failIfEmpty: false
25 changes: 0 additions & 25 deletions .github/workflows/check_links_config.json

This file was deleted.

0 comments on commit 82cca5e

Please sign in to comment.