mirror of
https://github.com/gaurav-nelson/github-action-markdown-link-check.git
synced 2024-07-14 23:30:26 +03:00
Maxdepth variable fix
This commit is contained in:
parent
952b0594c3
commit
6bd6d094d0
10
.github/workflows/push.yml
vendored
10
.github/workflows/push.yml
vendored
@ -1,5 +1,11 @@
|
||||
on: push
|
||||
name: New workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
name: Link Check
|
||||
jobs:
|
||||
markdown-link-check:
|
||||
runs-on: ubuntu-latest
|
||||
|
@ -20,32 +20,35 @@ echo -e "${BLUE}USE_VERBOSE_MODE: $2${NC}"
|
||||
echo -e "${BLUE}FOLDER_PATH: $4${NC}"
|
||||
echo -e "${BLUE}MAX_DEPTH: $5${NC}"
|
||||
|
||||
FIND_CALL="find ${FOLDER_PATH} -name \*.md -not -path './node_modules/*' -exec markdown-link-check {}"
|
||||
declare -a FIND_CALL
|
||||
|
||||
if [ "$5" -ne -1 ]; then
|
||||
FIND_CALL=('find' "${FOLDER_PATH}" '-name' '*.md' '-not' '-path' './node_modules/*' '-maxdepth' "${MAX_DEPTH}" '-exec' 'markdown-link-check' '{}')
|
||||
else
|
||||
FIND_CALL=('find' "${FOLDER_PATH}" '-name' '*.md' '-not' '-path' './node_modules/*' '-exec' 'markdown-link-check' '{}')
|
||||
fi
|
||||
|
||||
if [ -f "$CONFIG_FILE" ]; then
|
||||
echo -e "${BLUE}Using markdown-link-check configuration file: ${YELLOW}$CONFIG_FILE${NC}"
|
||||
FIND_CALL+=" --config ${CONFIG_FILE}"
|
||||
FIND_CALL+=('--config' "${CONFIG_FILE}")
|
||||
else
|
||||
echo -e "${BLUE}Cannot find ${YELLOW}$CONFIG_FILE${NC}"
|
||||
echo -e "${YELLOW}NOTE: See https://github.com/tcort/markdown-link-check#config-file-format to know more about"
|
||||
echo -e "customizing markdown-link-check by using a configuration file.${NC}"
|
||||
fi
|
||||
if [ "$5" -ne -1 ]; then
|
||||
FIND_CALL+=" --maxdepth ${MAX_DEPTH}"
|
||||
fi
|
||||
|
||||
if [ "$USE_QUIET_MODE" = "yes" ]; then
|
||||
FIND_CALL+=" -q"
|
||||
FIND_CALL+=('-q')
|
||||
fi
|
||||
|
||||
if [ "$USE_VERBOSE_MODE" = "yes" ]; then
|
||||
FIND_CALL+=" -v"
|
||||
FIND_CALL+=('-v')
|
||||
fi
|
||||
|
||||
FIND_CALL+=" \; &>> error.txt"
|
||||
FIND_CALL+=(';')
|
||||
|
||||
set -x
|
||||
eval "$FIND_CALL"
|
||||
"${FIND_CALL[@]}" &>> error.txt
|
||||
set +x
|
||||
|
||||
if [ -e error.txt ] ; then
|
||||
|
25
md/md-level-1/level-1a.md
Normal file
25
md/md-level-1/level-1a.md
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
## Test internal and external links
|
||||
|
||||
www.google.com
|
||||
|
||||
[This is a broken link](https://www.exampleexample.cox)
|
||||
|
||||
[This is another broken link](http://ignored-domain.com) but its ignored using a
|
||||
configuration file.
|
||||
|
||||
### Alpha
|
||||
|
||||
This [exists](#alpha).
|
||||
This [one does not](#does-not).
|
||||
References and definitions are [checked][alpha] [too][charlie].
|
||||
|
||||
### Bravo
|
||||
|
||||
Headings in `readme.md` are [not checked](file1.md#bravo).
|
||||
But [missing files are reported](missing-example.js).
|
||||
|
||||
[alpha]: #alpha
|
||||
[charlie]: #charlie
|
||||
|
||||
External file: [Charlie](./file2.md/#charlie)
|
10
md/md-level-1/level-1b.md
Normal file
10
md/md-level-1/level-1b.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Checking more links
|
||||
|
||||
## Bravo
|
||||
|
||||
This [doesn't exists](#alpha).
|
||||
This [one does](#bravo).
|
||||
|
||||
## Charlie
|
||||
|
||||
This is linked from file1.
|
25
md/md-level-1/md-level-2/level-2a.md
Normal file
25
md/md-level-1/md-level-2/level-2a.md
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
## Test internal and external links
|
||||
|
||||
www.google.com
|
||||
|
||||
[This is a broken link](https://www.exampleexample.cox)
|
||||
|
||||
[This is another broken link](http://ignored-domain.com) but its ignored using a
|
||||
configuration file.
|
||||
|
||||
### Alpha
|
||||
|
||||
This [exists](#alpha).
|
||||
This [one does not](#does-not).
|
||||
References and definitions are [checked][alpha] [too][charlie].
|
||||
|
||||
### Bravo
|
||||
|
||||
Headings in `readme.md` are [not checked](file1.md#bravo).
|
||||
But [missing files are reported](missing-example.js).
|
||||
|
||||
[alpha]: #alpha
|
||||
[charlie]: #charlie
|
||||
|
||||
External file: [Charlie](./file2.md/#charlie)
|
10
md/md-level-1/md-level-2/level-2b.md
Normal file
10
md/md-level-1/md-level-2/level-2b.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Checking more links
|
||||
|
||||
## Bravo
|
||||
|
||||
This [doesn't exists](#alpha).
|
||||
This [one does](#bravo).
|
||||
|
||||
## Charlie
|
||||
|
||||
This is linked from file1.
|
Loading…
Reference in New Issue
Block a user