name: Reusable - Markdown link check

on:
  workflow_call:

jobs:
  markdown-link-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: lycheeverse/lychee-action@v2
        with:
          # remove version after next release of lychee-action
          lycheeVersion: latest
          # excluding links to pull requests and issues is done for performance
          args: >
            --include-fragments
            --exclude "^https://github.com/open-telemetry/opentelemetry-java/(issue|pull)/\\d+$"
            --max-retries 6
            .
