From a8fdb03c68d50a0ac67852f5e5a3df9ef32df90a Mon Sep 17 00:00:00 2001 From: Liudmila Molkova Date: Wed, 8 Jan 2025 04:02:10 -0800 Subject: [PATCH] Use lychee for changelog links (#1723) Co-authored-by: Joao Grassi <5938087+joaopgrassi@users.noreply.github.com> --- .github/workflows/changelog.yml | 8 +++----- .lychee.toml | 3 ++- Makefile | 11 ++++++++--- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml index 95d54da7b..9ca83772a 100644 --- a/.github/workflows/changelog.yml +++ b/.github/workflows/changelog.yml @@ -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 diff --git a/.lychee.toml b/.lychee.toml index 672bacfeb..38599eea3 100644 --- a/.lychee.toml +++ b/.lychee.toml @@ -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 diff --git a/Makefile b/Makefile index a04d6aa7e..722b76edb 100644 --- a/Makefile +++ b/Makefile @@ -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 .