Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/scripts/lychee-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ 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/$',
# groovy-lang.org links are timing out when accessed via lychee
"^http://(docs.|)groovy-lang.org",
# mvnrepository.com links are returning 403 when accessed via lychee
"^https://mvnrepository.com",
]


15 changes: 14 additions & 1 deletion .github/workflows/reusable-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,27 @@ 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:
GITHUB_TOKEN: ${{ github.token }}
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
Loading