Skip to content

Commit ef8c8f3

Browse files
tgaffchipzollermeduzen
authored
Add documentation on using the --base param when testing local files (#211)
Co-authored-by: Chip Zoller <[email protected]> Co-authored-by: Mehdi <[email protected]>
1 parent 2ac9f03 commit ef8c8f3

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ jobs:
3535
'./**/*.rst'
3636
fail: true
3737

38+
- name: test --base argument
39+
uses: ./
40+
with:
41+
args: >-
42+
--base .
43+
--verbose
44+
--no-progress
45+
'./**/*.md'
46+
'./**/*.html'
47+
'./**/*.rst'
48+
fail: true
49+
3850
- name: Install jq
3951
run: sudo apt-get install jq
4052

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ jobs:
7373
fail: true
7474
```
7575

76+
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** (including root-relative paths) in the files are tested. You don't need to do this if you're testing a hosted site.
77+
78+
```yaml
79+
- name: Link Checker
80+
uses: lycheeverse/[email protected]
81+
with:
82+
fail: true
83+
args: --base . --verbose --no-progress './**/*.md' './**/*.html' './**/*.rst'
84+
```
85+
7686
## Passing arguments
7787

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

139149
It will compare and save the cache based on the given key.
@@ -153,7 +163,7 @@ If you need more control over when caches are restored and saved, you can split
153163
- name: Run lychee
154164
uses: lycheeverse/[email protected]
155165
with:
156-
args: "--cache --max-cache-age 1d ."
166+
args: "--base . --cache --max-cache-age 1d ."
157167
158168
- name: Save lychee cache
159169
uses: actions/cache/save@v3

0 commit comments

Comments
 (0)