diff --git a/.github/config/lychee.toml b/.github/config/lychee.toml new file mode 100644 index 00000000..d90ae5dd --- /dev/null +++ b/.github/config/lychee.toml @@ -0,0 +1,19 @@ +# Lychee configuration file +# See https://lychee.cli.rs/config/ + +timeout = 30 +retry_wait_time = 5 +max_retries = 6 +max_concurrency = 4 + +# Check link anchors +include_fragments = true + +remap = [ + # workaround for https://github.com/lycheeverse/lychee/issues/1729 + "https://github.com/(.*?)/(.*?)/blob/(.*?)/(.*#.*)$ https://raw.githubusercontent.com/$1/$2/$3/$4", +] + +exclude = [ + '^https://github.com/.*#discussion_r.*$', +] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3acfdcde..64c6c45d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -94,10 +94,10 @@ jobs: exit 1 fi - markdown-link-check: + link-check: # release branches are excluded to avoid unnecessary maintenance if: ${{ !startsWith(github.ref_name, 'release/') }} - uses: ./.github/workflows/reusable-markdown-link-check.yml + uses: ./.github/workflows/reusable-link-check.yml misspell-check: # release branches are excluded to avoid unnecessary maintenance diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml new file mode 100644 index 00000000..aa443606 --- /dev/null +++ b/.github/workflows/reusable-link-check.yml @@ -0,0 +1,19 @@ +name: Reusable - Link check + +on: + workflow_call: + +permissions: + contents: read + +jobs: + link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + + - name: Setup mise + uses: jdx/mise-action@5ac50f778e26fac95da98d50503682459e86d566 # v3.2.0 + + - name: Run link check + run: mise run link-check diff --git a/.github/workflows/reusable-markdown-link-check.yml b/.github/workflows/reusable-markdown-link-check.yml deleted file mode 100644 index eba11939..00000000 --- a/.github/workflows/reusable-markdown-link-check.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Reusable - Markdown link check - -on: - workflow_call: - -permissions: - contents: read - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - - uses: lycheeverse/lychee-action@885c65f3dc543b57c898c8099f4e08c8afd178a2 # v2.6.1 - with: - lycheeVersion: v0.18.1 - # excluding links to pull requests and issues is done for performance - args: > - --include-fragments - --exclude "^https://github.com/open-telemetry/opentelemetry-java-contrib/(issues|pull)/\\d+$" - --max-retries 6 - . diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..f09f5744 --- /dev/null +++ b/mise.toml @@ -0,0 +1,9 @@ +[tools] +lychee = "0.20.1" + +[tasks.link-check] +run = 'lychee --verbose --config .github/config/lychee.toml .' + +[settings] +# Only install tools explicitly defined in the [tools] section above +idiomatic_version_file_enable_tools = []