Use lychee for changelog links (#1723)
Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com>
This commit is contained in:
parent
f6cfb5b7c8
commit
a8fdb03c68
|
|
@ -75,9 +75,7 @@ jobs:
|
||||||
|| { echo "New ./.chloggen/*.yaml file failed validation."; exit 1; }
|
|| { echo "New ./.chloggen/*.yaml file failed validation."; exit 1; }
|
||||||
|
|
||||||
# In order to validate any links in the yaml file, render the config to markdown
|
# 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: |
|
run: |
|
||||||
make chlog-preview 2> changelog_preview.md
|
make chlog-preview &> changelog_preview.md
|
||||||
cat changelog_preview.md
|
make markdown-link-check-changelog-preview
|
||||||
- name: Run markdown-link-check
|
|
||||||
run: make markdown-link-check-changelog-preview
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ accept = ["200..=299", "403"]
|
||||||
exclude = [
|
exclude = [
|
||||||
"^https://www.foo.bar",
|
"^https://www.foo.bar",
|
||||||
# excluding links to pull requests and issues is done for performance
|
# 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
|
# better to be safe and avoid failures
|
||||||
|
|
|
||||||
11
Makefile
11
Makefile
|
|
@ -73,13 +73,18 @@ markdown-link-check:
|
||||||
lycheeverse/lychee \
|
lycheeverse/lychee \
|
||||||
--config home/repo/.lychee.toml \
|
--config home/repo/.lychee.toml \
|
||||||
--root-dir /home/repo \
|
--root-dir /home/repo \
|
||||||
-v \
|
--verbose \
|
||||||
home/repo
|
home/repo
|
||||||
|
|
||||||
.PHONY: markdown-link-check-changelog-preview
|
.PHONY: markdown-link-check-changelog-preview
|
||||||
markdown-link-check-changelog-preview:
|
markdown-link-check-changelog-preview:
|
||||||
@if ! npm ls markdown-link-check; then npm install; fi
|
docker run --rm \
|
||||||
npx --no -- markdown-link-check --quiet --config .markdown_link_check_config.json changelog_preview.md;
|
--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
|
# This target runs markdown-toc on all files that contain
|
||||||
# a comment <!-- tocstop -->.
|
# a comment <!-- tocstop -->.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue