Skip to content
Merged
Changes from all 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
13 changes: 7 additions & 6 deletions .github/workflows/offline-link-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ jobs:
link_check:
runs-on: ubuntu-latest
steps:
uses: actions/checkout@v5
uses: lycheeverse/lychee-action@v2
# Only check local files, no network requests
args: --offline --no-progress 'src/content/docs/**/*.md'
# Fail job when lychee returns a non-zero exit code
fail: true
- uses: actions/checkout@v5
- uses: lycheeverse/lychee-action@v2
with:
# Only check local files, no network requests
args: --config './lychee.toml' --no-progress --offline --root-dir "$GITHUB_WORKSPACE/public/" 'src/content/docs/**/*.md'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JimMadge i think you are fixing something that's been bugging us at pyOpenSci for a while. Every time we add a new page to our site, lychee breaks. So this forces lychee to check links "internally" vs online . is that correct?

Thank you for this!!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the --offline flag means Lychee will only check links to local files (and maybe local network, not sure 😅).

So, I've found it useful for CI. You can check all of the internal links in your built HTML work, but you don't block PRs because of false positives when checking sites over the internet.

# Fail job when lychee returns a non-zero exit code
fail: true