File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 25
25
- name : test explicit lychee version
26
26
uses : ./
27
27
with :
28
+ checkbox : false # not supported in v0.15.1
28
29
lycheeVersion : v0.15.1
29
30
30
31
- name : test nightly lychee version
@@ -286,6 +287,7 @@ jobs:
286
287
- name : test explicit lychee version
287
288
uses : ./
288
289
with :
290
+ checkbox : false # not supported in v0.15.1
289
291
lycheeVersion : v0.15.1
290
292
291
293
- name : test nightly lychee version
Original file line number Diff line number Diff line change @@ -28,12 +28,16 @@ inputs:
28
28
required : false
29
29
lycheeVersion :
30
30
description : " Use custom version of lychee link checker"
31
- default : v0.18.0
31
+ default : v0.18.1
32
32
required : false
33
33
output :
34
34
description : " Summary output file path"
35
35
default : " lychee/out.md"
36
36
required : false
37
+ checkbox :
38
+ description : " Add Markdown Styled Checkboxes to the output"
39
+ default : true
40
+ required : false
37
41
token :
38
42
description : " Your GitHub Access Token, defaults to: {{ github.token }}"
39
43
default : ${{ github.token }}
@@ -117,6 +121,7 @@ runs:
117
121
INPUT_FAILIFEMPTY : ${{ inputs.FAILIFEMPTY }}
118
122
INPUT_FORMAT : ${{ inputs.FORMAT }}
119
123
INPUT_JOBSUMMARY : ${{ inputs.JOBSUMMARY }}
124
+ INPUT_CHECKBOX : ${{ inputs.CHECKBOX }}
120
125
INPUT_OUTPUT : ${{ inputs.OUTPUT }}
121
126
shell : bash
122
127
branding :
Original file line number Diff line number Diff line change @@ -28,14 +28,32 @@ FORMAT=""
28
28
# If `format` occurs in args, ignore the value from `INPUT_FORMAT`
29
29
[[ " $ARGS " =~ " --format " ]] || FORMAT=" --format ${INPUT_FORMAT} "
30
30
31
+
31
32
# If `output` occurs in args and `INPUT_OUTPUT` is set, exit with an error
32
33
if [[ " $ARGS " =~ " --output " ]] && [ -n " ${INPUT_OUTPUT:- } " ]; then
33
34
echo " Error: 'output' is set in args as well as in the action configuration. Please remove one of them."
34
35
exit 1
35
36
fi
36
37
38
+ # If `--mode` occurs in args and `INPUT_CHECKBOX` is set, exit with an error
39
+ # Use `--mode` instead of `--mode task` to ensure that the checkbox is not getting overwritten
40
+ if [[ " $ARGS " =~ " --mode" ]] && [ -n " ${INPUT_CHECKBOX:- } " ]; then
41
+ echo " Error: '--mode' is set in args but 'checkbox' is set in the action configuration. Please remove one of them to avoid conflicts."
42
+ exit 1
43
+ fi
44
+
45
+ CHECKBOX=" "
46
+ if [ " ${INPUT_CHECKBOX} " = true ]; then
47
+ # Check if the version is higher than 0.18.1
48
+ if [ " $( lychee --version | head -n1 | cut -d" " -f4) " -lt 0.18.1 ]; then
49
+ echo " WARNING: 'checkbox' is not supported in lychee versions lower than 0.18.1. Continuing without 'checkbox'."
50
+ else
51
+ CHECKBOX=" --mode task"
52
+ fi
53
+ fi
54
+
37
55
# Execute lychee
38
- eval lychee ${FORMAT} --output ${LYCHEE_TMP} ${ARGS}
56
+ eval lychee ${CHECKBOX} ${ FORMAT} --output ${LYCHEE_TMP} ${ARGS}
39
57
LYCHEE_EXIT_CODE=$?
40
58
41
59
# If no links were found and `failIfEmpty` is set to `true` (and it is by default),
You can’t perform that action at this time.
0 commit comments