Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add documentation on using the param when testing local files (as in… #211

Merged
merged 9 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ jobs:
'./**/*.rst'
fail: true

- name: test --base argument
uses: ./
with:
args: >-
--base .
--verbose
--no-progress
'./**/*.md'
'./**/*.html'
'./**/*.rst'
fail: true

- name: Install jq
run: sudo apt-get install jq

Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ jobs:
fail: true
```

You may want to add additional arguments to the above. In particular if you're testing a site directly from the file-system (as in the above), you'll likely want to set the argument `--base .` to ensure that **all links** in the files are tested. You don't need to do this if you're testing a hosted site.
tgaff marked this conversation as resolved.
Show resolved Hide resolved

```
mre marked this conversation as resolved.
Show resolved Hide resolved
- name: Link Checker
uses: lycheeverse/[email protected]
with:
fail: true
args: "--base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'"
mre marked this conversation as resolved.
Show resolved Hide resolved
```

## Passing arguments

This action uses [lychee] for link checking.
Expand Down Expand Up @@ -102,7 +112,7 @@ Here is how to pass the arguments.
uses: lycheeverse/[email protected]
with:
# Check all markdown and html files in repo (default)
args: --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
args: --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
# Use json as output format (instead of markdown)
format: json
# Use different output file path
Expand Down Expand Up @@ -133,7 +143,7 @@ In order to mitigate issues regarding rate limiting or to reduce stress on exter
- name: Run lychee
uses: lycheeverse/[email protected]
with:
args: "--cache --max-cache-age 1d ."
args: "--base . --cache --max-cache-age 1d ."
```

It will compare and save the cache based on the given key.
Expand All @@ -153,7 +163,7 @@ If you need more control over when caches are restored and saved, you can split
- name: Run lychee
uses: lycheeverse/[email protected]
with:
args: "--cache --max-cache-age 1d ."
args: "--base . --cache --max-cache-age 1d ."

- name: Save lychee cache
uses: actions/cache/save@v3
Expand Down