Use lychee for changelog links (#1723)

Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
This commit is contained in:
Liudmila Molkova 2025-01-08 04:02:10 -08:00 committed by GitHub
parent f6cfb5b7c8
commit a8fdb03c68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 9 deletions

View File

@ -75,9 +75,7 @@ jobs:
|| { echo "New ./.chloggen/*.yaml file failed validation."; exit 1; }
# In order to validate any links in the yaml file, render the config to markdown
- name: Render .chloggen changelog entries
- name: Run markdown-link-check on the changelog
run: |
make chlog-preview 2> changelog_preview.md
cat changelog_preview.md
- name: Run markdown-link-check
run: make markdown-link-check-changelog-preview
make chlog-preview &> changelog_preview.md
make markdown-link-check-changelog-preview

View File

@ -5,7 +5,8 @@ accept = ["200..=299", "403"]
exclude = [
"^https://www.foo.bar",
# excluding links to pull requests and issues is done for performance
"^https://github.com/open-telemetry/semantic-conventions/(pull|issue)/\\d+$"
"^https://github.com/open-telemetry/semantic-conventions/(pull|issues)/\\d+$",
"^https://github.com/open-telemetry/opentelemetry-specification/(pull|issues)/\\d+$"
]
# better to be safe and avoid failures

View File

@ -73,13 +73,18 @@ markdown-link-check:
lycheeverse/lychee \
--config home/repo/.lychee.toml \
--root-dir /home/repo \
-v \
--verbose \
home/repo
.PHONY: markdown-link-check-changelog-preview
markdown-link-check-changelog-preview:
@if ! npm ls markdown-link-check; then npm install; fi
npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json changelog_preview.md;
docker run --rm \
--mount 'type=bind,source=$(PWD),target=/home/repo' \
lycheeverse/lychee \
--config /home/repo/.lychee.toml \
--root-dir /home/repo \
--verbose \
home/repo/changelog_preview.md
# This target runs markdown-toc on all files that contain
# a comment <!-- tocstop -->.