Skip to content

Commit

Permalink
Merge pull request #184 from gaurav-nelson/fix-158
Browse files Browse the repository at this point in the history
Respect folder patch when modified only is used
  • Loading branch information
gaurav-nelson committed May 24, 2023
2 parents 6eb9643 + 5525016 commit 322b231
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -260,3 +260,6 @@ GitHub Action - Markdown link check follows the [GitHub recommended versioning s
<img src="https://i.imgur.com/1Q1YoHz.gif" alt="Buy me a coffee.">
</a>
</p>


See https://pubsadasdsadasdasdasdas.aasasdas.odasdarg/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07
8 changes: 6 additions & 2 deletions entrypoint.sh
Expand Up @@ -128,9 +128,9 @@ check_additional_files () {

if [ -n "$FILES" ]; then
if [ "$MAX_DEPTH" -ne -1 ]; then
FIND_CALL=('find' '.' '-type' 'f' '(' ${FILES} ')' '-not' '-path' './node_modules/*' '-maxdepth' "${MAX_DEPTH}" '-exec' 'markdown-link-check' '{}')
FIND_CALL=('find' ${FOLDERS} '-type' 'f' '(' ${FILES} ')' '-not' '-path' './node_modules/*' '-maxdepth' "${MAX_DEPTH}" '-exec' 'markdown-link-check' '{}')
else
FIND_CALL=('find' '.' '-type' 'f' '(' ${FILES} ')' '-not' '-path' './node_modules/*' '-exec' 'markdown-link-check' '{}')
FIND_CALL=('find' ${FOLDERS} '-type' 'f' '(' ${FILES} ')' '-not' '-path' './node_modules/*' '-exec' 'markdown-link-check' '{}')
fi

add_options
Expand Down Expand Up @@ -164,6 +164,10 @@ if [ "$CHECK_MODIFIED_FILES" = "yes" ]; then
git fetch origin "${BASE_BRANCH}" --depth=1 > /dev/null
MASTER_HASH=$(git rev-parse origin/"${BASE_BRANCH}")

if [ -z "$FOLDERS" ]; then
FOLDERS="."
fi

FIND_CALL=('markdown-link-check')

add_options
Expand Down
6 changes: 4 additions & 2 deletions md/dir2/level-1a.md
Expand Up @@ -6,7 +6,7 @@ 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.
configuration file.

### Alpha

Expand All @@ -22,4 +22,6 @@ But [missing files are reported](missing-example.js).
[alpha]: #alpha
[charlie]: #charlie

External file: [Charlie](./file2.md/#charlie)
External file: [Charlie](./file2.md/#charlie)

Modified.

0 comments on commit 322b231

Please sign in to comment.