File tree Expand file tree Collapse file tree 6 files changed +90
-11
lines changed Expand file tree Collapse file tree 6 files changed +90
-11
lines changed Original file line number Diff line number Diff line change 1
- on : push
2
- name : New workflow
1
+ on :
2
+ push :
3
+ branches :
4
+ - master
5
+ pull_request :
6
+ branches :
7
+ - master
8
+ name : Link Check
3
9
jobs :
4
10
markdown-link-check :
5
11
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -20,32 +20,35 @@ echo -e "${BLUE}USE_VERBOSE_MODE: $2${NC}"
20
20
echo -e " ${BLUE} FOLDER_PATH: $4 ${NC} "
21
21
echo -e " ${BLUE} MAX_DEPTH: $5 ${NC} "
22
22
23
- FIND_CALL=" find ${FOLDER_PATH} -name \*.md -not -path './node_modules/*' -exec markdown-link-check {}"
23
+ declare -a FIND_CALL
24
+
25
+ if [ " $5 " -ne -1 ]; then
26
+ FIND_CALL=(' find' " ${FOLDER_PATH} " ' -name' ' *.md' ' -not' ' -path' ' ./node_modules/*' ' -maxdepth' " ${MAX_DEPTH} " ' -exec' ' markdown-link-check' ' {}' )
27
+ else
28
+ FIND_CALL=(' find' " ${FOLDER_PATH} " ' -name' ' *.md' ' -not' ' -path' ' ./node_modules/*' ' -exec' ' markdown-link-check' ' {}' )
29
+ fi
24
30
25
31
if [ -f " $CONFIG_FILE " ]; then
26
32
echo -e " ${BLUE} Using markdown-link-check configuration file: ${YELLOW} $CONFIG_FILE ${NC} "
27
- FIND_CALL+=" --config ${CONFIG_FILE} "
33
+ FIND_CALL+=( ' --config' " ${CONFIG_FILE} " )
28
34
else
29
35
echo -e " ${BLUE} Cannot find ${YELLOW} $CONFIG_FILE ${NC} "
30
36
echo -e " ${YELLOW} NOTE: See https://github.com/tcort/markdown-link-check#config-file-format to know more about"
31
37
echo -e " customizing markdown-link-check by using a configuration file.${NC} "
32
38
fi
33
- if [ " $5 " -ne -1 ]; then
34
- FIND_CALL+=" --maxdepth ${MAX_DEPTH} "
35
- fi
36
39
37
40
if [ " $USE_QUIET_MODE " = " yes" ]; then
38
- FIND_CALL+=" -q "
41
+ FIND_CALL+=( ' -q ' )
39
42
fi
40
43
41
44
if [ " $USE_VERBOSE_MODE " = " yes" ]; then
42
- FIND_CALL+=" -v "
45
+ FIND_CALL+=( ' -v ' )
43
46
fi
44
47
45
- FIND_CALL+=" \; &>> error.txt "
48
+ FIND_CALL+=( ' ; ' )
46
49
47
50
set -x
48
- eval " $ FIND_CALL"
51
+ " ${ FIND_CALL[@]} " & >> error.txt
49
52
set +x
50
53
51
54
if [ -e error.txt ] ; then
Original file line number Diff line number Diff line change
1
+
2
+ ## Test internal and external links
3
+
4
+ www.google.com
5
+
6
+ [ This is a broken link] ( https://www.exampleexample.cox )
7
+
8
+ [ This is another broken link] ( http://ignored-domain.com ) but its ignored using a
9
+ configuration file.
10
+
11
+ ### Alpha
12
+
13
+ This [ exists] ( #alpha ) .
14
+ This [ one does not] ( #does-not ) .
15
+ References and definitions are [ checked] [ alpha ] [ too] [ charlie ] .
16
+
17
+ ### Bravo
18
+
19
+ Headings in ` readme.md ` are [ not checked] ( file1.md#bravo ) .
20
+ But [ missing files are reported] ( missing-example.js ) .
21
+
22
+ [ alpha ] : #alpha
23
+ [ charlie ] : #charlie
24
+
25
+ External file: [ Charlie] ( ./file2.md/#charlie )
Original file line number Diff line number Diff line change
1
+ # Checking more links
2
+
3
+ ## Bravo
4
+
5
+ This [ doesn't exists] ( #alpha ) .
6
+ This [ one does] ( #bravo ) .
7
+
8
+ ## Charlie
9
+
10
+ This is linked from file1.
Original file line number Diff line number Diff line change
1
+
2
+ ## Test internal and external links
3
+
4
+ www.google.com
5
+
6
+ [ This is a broken link] ( https://www.exampleexample.cox )
7
+
8
+ [ This is another broken link] ( http://ignored-domain.com ) but its ignored using a
9
+ configuration file.
10
+
11
+ ### Alpha
12
+
13
+ This [ exists] ( #alpha ) .
14
+ This [ one does not] ( #does-not ) .
15
+ References and definitions are [ checked] [ alpha ] [ too] [ charlie ] .
16
+
17
+ ### Bravo
18
+
19
+ Headings in ` readme.md ` are [ not checked] ( file1.md#bravo ) .
20
+ But [ missing files are reported] ( missing-example.js ) .
21
+
22
+ [ alpha ] : #alpha
23
+ [ charlie ] : #charlie
24
+
25
+ External file: [ Charlie] ( ./file2.md/#charlie )
Original file line number Diff line number Diff line change
1
+ # Checking more links
2
+
3
+ ## Bravo
4
+
5
+ This [ doesn't exists] ( #alpha ) .
6
+ This [ one does] ( #bravo ) .
7
+
8
+ ## Charlie
9
+
10
+ This is linked from file1.
You can’t perform that action at this time.
0 commit comments