diff --git a/.github/scripts/lychee-config.toml b/.github/scripts/lychee-config.toml index d368a2404..b2d5285f1 100644 --- a/.github/scripts/lychee-config.toml +++ b/.github/scripts/lychee-config.toml @@ -6,11 +6,7 @@ max_concurrency = 4 # Check link anchors include_fragments = true -# excluding links to pull requests and issues is done for performance -# sonatype snapshots are currrently unbrowseable exclude = [ + # excluding links to pull requests and issues is done for performance "^https://github.com/open-telemetry/opentelemetry-java-contrib/(issues|pull)/\\d+$", - '^https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/contrib/$', ] - - diff --git a/.github/workflows/reusable-link-check.yml b/.github/workflows/reusable-link-check.yml index da70758ff..dea394625 100644 --- a/.github/workflows/reusable-link-check.yml +++ b/.github/workflows/reusable-link-check.yml @@ -32,6 +32,19 @@ jobs: echo "files=$modified_files" >> $GITHUB_OUTPUT echo "Modified files: $modified_files" + - name: Check if lychee config was modified + if: github.event_name == 'pull_request' + id: config-check + run: | + merge_base=$(git merge-base origin/${{ github.base_ref }} HEAD) + config_modified=$(git diff --name-only $merge_base...${{ github.event.pull_request.head.sha }} \ + | grep -E '\.github/scripts/(lychee-config\.toml|link-check\.sh|dependencies\.Dockerfile)$' || true) + if [ -n "$config_modified" ]; then + echo "modified=true" >> $GITHUB_OUTPUT + else + echo "modified=false" >> $GITHUB_OUTPUT + fi + - name: Link check - all links (modified files only) if: github.event_name == 'pull_request' && steps.modified-files.outputs.files != '' env: @@ -39,7 +52,7 @@ jobs: run: ./.github/scripts/link-check.sh ${{ steps.modified-files.outputs.files }} - name: Link check - all links (all files) - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || steps.config-check.outputs.modified == 'true' env: GITHUB_TOKEN: ${{ github.token }} run: ./.github/scripts/link-check.sh