Skip to content

Commit

Permalink
Merge pull request #6 from reviewdog/ghglob
Browse files Browse the repository at this point in the history
Fix target patterns handline
  • Loading branch information
haya14busa authored Feb 8, 2020
2 parents 60b6517 + 27b4675 commit 1af4192
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
level: info
patterns: |
README.md

test-pr-review:
if: github.event_name == 'pull_request'
Expand All @@ -41,7 +39,5 @@ jobs:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
level: info
patterns: |
**/*.md
!README.md
patterns: "**.md"
custom_api_endpoint: https://languagetool.org/api
9 changes: 7 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ if [ -n "${INPUT_ENABLED_ONLY}" ]; then
DATA="$DATA&enabledOnly=${INPUT_ENABLED_ONLY}"
fi

# Disable glob to handle glob patterns with ghglob command instead of with shell.
set -o noglob
FILES="$(git ls-files | ghglob ${INPUT_PATTERNS})"
set +o noglob

run_langtool() {
for FILE in $(git ls-files | ghglob ${INPUT_PATTERNS}); do
for FILE in ${FILES}; do
echo "Checking ${FILE}..." >&2
curl --silent \
--request POST \
--data "${DATA}" \
--data-urlencode "text=$(cat "${FILE}")" \
"${API_ENDPOINT}/v2/check" | tee /dev/stderr | \
"${API_ENDPOINT}/v2/check" | \
FILE="${FILE}" tmpl /langtool.tmpl
done
}
Expand Down

0 comments on commit 1af4192

Please sign in to comment.