Skip to content

Commit ae46991

Browse files
authored
Add missing argument failIfEmpty (#261)
1 parent 7cd0af4 commit ae46991

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,17 @@ lychee arguments can be passed to the action via the `args` parameter.
5252

5353
On top of that, the action also supports some additional arguments.
5454

55-
| Argument | Examples | Description |
56-
| ------------- | ----------------------- | -------------------------------------------------------------------------------- |
55+
| Argument | Examples | Description |
56+
| ------------- | ----------------------- | ------------------------------------------------------------------------------- |
5757
| args | `--cache`, `--insecure` | See [lychee's documentation][lychee-args] for all arguments and values |
5858
| debug | `false` | Enable debug output in action (set -x). Helpful for troubleshooting |
5959
| fail | `false` | Fail workflow run on error (i.e. when [lychee exit code][lychee-exit] is not 0) |
60+
| failIfEmpty | `false` | Fail entire pipeline if no links were found |
6061
| format | `markdown`, `json` | Summary output format |
6162
| jobSummary | `false` | Write GitHub job summary (on Markdown output only) |
6263
| lycheeVersion | `v0.15.0`, `nightly` | Overwrite the lychee version to be used |
6364
| output | `lychee/results.md` | Summary output file path |
64-
| token | `""` | Custom GitHub token to use for API calls |
65+
| token | `""` | Custom GitHub token to use for API calls |
6566

6667
See [action.yml](./action.yml) for a full list of supported arguments and their default values.
6768

@@ -79,7 +80,7 @@ Here is how to pass the arguments.
7980
format: json
8081
# Use different output file path
8182
output: /tmp/foo.txt
82-
# Use a custom GitHub token, which
83+
# Use a custom GitHub token, which
8384
token: ${{ secrets.CUSTOM_TOKEN }}
8485
# Don't fail action on broken links
8586
fail: false
@@ -113,6 +114,7 @@ So in this setup, as long as a user triggers the CI run from the same commit, it
113114
For restoring the cache, the most recent available one is used (commit hash doesn't matter).
114115

115116
If you need more control over when caches are restored and saved, you can split the cache step and e.g. ensure to always save the cache (also when the link check step fails):
117+
116118
```yml
117119
- name: Restore lychee cache
118120
id: restore-cache

entrypoint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ eval lychee ${FORMAT} --output ${LYCHEE_TMP} ${ARGS}
3232
exit_code=$?
3333

3434
# Overwrite the exit code in case no links were found
35-
# and `fail-if-empty` is set to `true` (and it is by default)
35+
# and `failIfEmpty` is set to `true` (and it is by default)
3636
if [ "${INPUT_FAILIFEMPTY}" = "true" ]; then
3737
# Explicitly set INPUT_FAIL to true to ensure the script fails
3838
# if no links are found
3939
INPUT_FAIL=true
4040
# This is a somewhat crude way to check the Markdown output of lychee
4141
if grep -E 'Total\s+\|\s+0' "${LYCHEE_TMP}"; then
4242
echo "No links were found. This usually indicates a configuration error." >> "${LYCHEE_TMP}"
43-
echo "If this was expected, set 'fail-if-empty: false' in the args." >> "${LYCHEE_TMP}"
43+
echo "If this was expected, set 'failIfEmpty: false' in the args." >> "${LYCHEE_TMP}"
4444
exit_code=1
4545
fi
4646
fi

0 commit comments

Comments
 (0)