Skip to content

Commit

Permalink
Use lychee for changelog links (#1723)
Browse files Browse the repository at this point in the history
Co-authored-by: Joao Grassi <[email protected]>
  • Loading branch information
lmolkova and joaopgrassi authored Jan 8, 2025
1 parent f6cfb5b commit a8fdb03
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .lychee.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->.
Expand Down

0 comments on commit a8fdb03

Please sign in to comment.