8
8
CUSTOM_OUTPUT_RELATIVE_PATH : lychee/custom_output.md
9
9
CUSTOM_OUTPUT_ABSOLUTE_PATH : /tmp/report.md
10
10
CUSTOM_OUTPUT_DUMP_PATH : /tmp/dump.md
11
-
11
+
12
12
jobs :
13
13
lychee-action :
14
14
runs-on : ubuntu-latest
57
57
with :
58
58
output : " ${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}"
59
59
debug : true
60
-
60
+
61
61
- name : test custom output relative path - validation
62
62
run : |
63
63
echo "Checking custom output file at ${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}"
@@ -68,13 +68,13 @@ jobs:
68
68
echo "Found. Contents:"
69
69
cat "${{ env.CUSTOM_OUTPUT_RELATIVE_PATH }}"
70
70
fi
71
-
71
+
72
72
- name : test custom output absolute path - creation
73
73
uses : ./
74
74
with :
75
75
output : " ${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}"
76
76
debug : true
77
-
77
+
78
78
- name : test custom output absolute path - validation
79
79
run : |
80
80
echo "Checking custom output file at ${{ env.CUSTOM_OUTPUT_ABSOLUTE_PATH }}"
92
92
args : --dump './**/*.md' './**/*.html' './**/*.rst'
93
93
output : " ${{ env.CUSTOM_OUTPUT_DUMP_PATH }}"
94
94
debug : true
95
-
95
+
96
96
- name : test dump with custom output path - validation
97
97
run : |
98
98
echo "Checking dump output file at ${{ env.CUSTOM_OUTPUT_DUMP_PATH }}"
@@ -104,6 +104,27 @@ jobs:
104
104
cat "${{ env.CUSTOM_OUTPUT_DUMP_PATH }}"
105
105
fi
106
106
107
+ - name : test failIfEmpty - no links in input should fail the pipeline
108
+ id : fail_if_empty_test
109
+ uses : ./
110
+ with :
111
+ args : --verbose --no-progress fixtures/empty.md
112
+ debug : true
113
+
114
+ # Explictly check the exit code of the previous step
115
+ # as it's expected to fail
116
+ - name : Check failIfEmpty
117
+ if : steps.fail_if_empty_test.outcome != 'failure'
118
+ run : |
119
+ echo "FailIfEmpty should have failed because no links were found."
120
+ exit 1
121
+
122
+ - name : test disable failIfEmpty - it's okay if no links are found
123
+ uses : ./
124
+ with :
125
+ args : --no-progress fixtures/empty.md
126
+ failIfEmpty : false
127
+
107
128
- name : Install jq
108
129
run : sudo apt-get install jq
109
130
0 commit comments