Skip to content

Commit

Permalink
Respect folder patch when modified only is used
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav-nelson committed May 24, 2023
1 parent 6eb9643 commit 72e99c3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/push.yml
Expand Up @@ -9,6 +9,7 @@ jobs:
uses: ./
with:
check-modified-files-only: 'yes'
folder-path:'./md'
markdown-link-check-folders:
runs-on: ubuntu-latest
steps:
Expand Down
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 72e99c3

Please sign in to comment.