diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad0fa2e..d26a544 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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' @@ -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 diff --git a/entrypoint.sh b/entrypoint.sh index 4314fd5..2bf4098 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 }