diff --git a/.github/scripts/markdown-link-check-with-retry.sh b/.github/scripts/markdown-link-check-with-retry.sh deleted file mode 100755 index 9a81e8df9..000000000 --- a/.github/scripts/markdown-link-check-with-retry.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -e - -# this script helps to reduce sporadic link check failures by retrying at a file-by-file level - -retry_count=3 - -for file in "$@"; do - for i in $(seq 1 $retry_count); do - if markdown-link-check --config "$(dirname "$0")/../config/markdown-link-check-config.json" \ - "$file"; then - break - elif [[ $i -eq $retry_count ]]; then - exit 1 - fi - sleep 5 - done -done diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a3859fa3..d3680258c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,8 +101,8 @@ jobs: name: integration-test-results path: jmx-metrics/build/reports/tests/integrationTest - markdown-link-check: - uses: ./.github/workflows/reusable-markdown-link-check.yml + link-check: + uses: ./.github/workflows/reusable-link-check.yml markdown-lint-check: uses: ./.github/workflows/reusable-markdown-lint.yml @@ -125,7 +125,7 @@ jobs: # and so would not short-circuit if used in the second-last position name: publish-snapshots${{ (github.ref_name != 'main' || github.repository != 'open-telemetry/opentelemetry-java-contrib') && ' (skipped)' || '' }} needs: - # intentionally not blocking snapshot publishing on markdown-link-check or misspell-check + # intentionally not blocking snapshot publishing on link-check or misspell-check - build - integration-test runs-on: ubuntu-latest diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml new file mode 100644 index 000000000..ae577a584 --- /dev/null +++ b/.github/workflows/reusable-link-check.yml @@ -0,0 +1,31 @@ +name: Reusable - Check links + +on: + workflow_call: + +jobs: + check-links-github: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # need to rate limit requests to github.com in order to avoid 429s + - uses: lycheeverse/lychee-action@v2 + with: + args: > + --include-fragments + --include github.com + --max-concurrency 2 + . + + check-links-other: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: lycheeverse/lychee-action@v2 + with: + args: > + --include-fragments + --exclude github.com + . diff --git a/.github/workflows/reusable-markdown-link-check.yml b/.github/workflows/reusable-markdown-link-check.yml deleted file mode 100644 index 4e7ad15c4..000000000 --- a/.github/workflows/reusable-markdown-link-check.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Reusable - Markdown link check - -on: - workflow_call: - -jobs: - markdown-link-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install markdown-link-check - # TODO(jack-berg): use latest when config file reading bug is fixed: https://github.com/tcort/markdown-link-check/issues/246 - run: npm install -g markdown-link-check@3.10.3 - - - name: Run markdown-link-check - run: | - find . -type f \ - -name '*.md' \ - -not -path './CHANGELOG.md' \ - | xargs .github/scripts/markdown-link-check-with-retry.sh