Skip to content

Commit 905faa1

Browse files
committed
Update pr
1 parent ad3b13a commit 905faa1

File tree

4 files changed

+6
-50
lines changed

4 files changed

+6
-50
lines changed

.github/workflows/test.yml

-8
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ jobs:
2121

2222
- name: test defaults
2323
uses: ./
24-
with:
25-
fail: true
2624

2725
- name: test explicit lychee version
2826
uses: ./
@@ -39,7 +37,6 @@ jobs:
3937
'./**/*.md'
4038
'./**/*.html'
4139
'./**/*.rst'
42-
fail: true
4340
4441
- name: test --base argument
4542
uses: ./
@@ -51,7 +48,6 @@ jobs:
5148
'./**/*.md'
5249
'./**/*.html'
5350
'./**/*.rst'
54-
fail: true
5551
5652
- name: test custom output relative path - creation
5753
uses: ./
@@ -136,7 +132,6 @@ jobs:
136132
args: -v fixtures/TEST.md
137133
format: json
138134
output: ${{ github.workspace }}/foo_md.json
139-
fail: true
140135

141136
- name: Validate JSON - Markdown
142137
run: |
@@ -151,7 +146,6 @@ jobs:
151146
args: -v fixtures/TEST.rst
152147
format: json
153148
output: ${{ github.workspace }}/foo_rst.json
154-
fail: true
155149

156150
- name: Validate JSON - rST
157151
run: |
@@ -164,15 +158,13 @@ jobs:
164158
uses: ./
165159
with:
166160
args: --exclude-mail .
167-
fail: true
168161

169162
- name: test format override
170163
uses: ./
171164
with:
172165
args: --format markdown -v fixtures/TEST.md
173166
format: doesnotexist # gets ignored if format set in args
174167
output: ${{ github.workspace }}/foo.txt
175-
fail: true
176168

177169
- name: test debug
178170
uses: ./

README.md

+2-39
Original file line numberDiff line numberDiff line change
@@ -46,43 +46,6 @@ jobs:
4646
If you always want to use the latest features but avoid breaking changes, you can replace the version with
4747
`lycheeverse/lychee-action@v1`.
4848

49-
### Alternative approach:
50-
51-
This will check all repository links during any git push event and for all pull
52-
requests. If there's an error, it will fail the action. This has the benefit of
53-
ensuring that during a Pull Request, no link is added that is broken and any
54-
existing link will be caught if they become broken. Save this under
55-
`.github/workflows/links-fail-fast.yml`:
56-
57-
```yaml
58-
name: Links (Fail Fast)
59-
60-
on:
61-
push:
62-
pull_request:
63-
64-
jobs:
65-
linkChecker:
66-
runs-on: ubuntu-latest
67-
steps:
68-
- uses: actions/checkout@v4
69-
70-
- name: Link Checker
71-
uses: lycheeverse/[email protected]
72-
with:
73-
fail: true
74-
```
75-
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-
8649
## Passing arguments
8750

8851
This action uses [lychee] for link checking.
@@ -119,8 +82,8 @@ Here is how to pass the arguments.
11982
output: /tmp/foo.txt
12083
# Use a custom GitHub token, which
12184
token: ${{ secrets.CUSTOM_TOKEN }}
122-
# Fail action on broken links
123-
fail: true
85+
# Don't fail action on broken links
86+
fail: false
12487
```
12588

12689
(If you need a token that requires permissions that aren't available in the

action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ inputs:
1111
required: false
1212
fail:
1313
description: "Fail entire pipeline on error (i.e. when lychee exit code is not 0)"
14-
default: false
14+
default: true
1515
required: false
1616
failIfEmpty:
1717
description: "Fail entire pipeline if no links were found"

entrypoint.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ fi
6464
# Pass lychee exit code to next step
6565
echo "lychee_exit_code=$exit_code" >> $GITHUB_ENV
6666

67-
# If `fail` is set to `true`, propagate the real exit code to the workflow
68-
# runner. This will cause the pipeline to fail on `exit != 0`.
67+
# If `fail` is set to `true` (and it is by default), propagate the real exit
68+
# value to the workflow runner. This will cause the pipeline to fail on
69+
# `exit != # 0`.
6970
if [ "$INPUT_FAIL" = true ] ; then
7071
exit ${exit_code}
7172
fi

0 commit comments

Comments
 (0)