Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(maint) Change curl to import the text from a file #1

Merged
merged 1 commit into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
set -eo pipefail

Check warning on line 2 in entrypoint.sh

View workflow job for this annotation

GitHub Actions / runner / shellcheck

[shellcheck] reported by reviewdog 🐶 In POSIX sh, set option pipefail is undefined. [SC3040](https://github.com/koalaman/shellcheck/wiki/SC3040) Raw Output: ./entrypoint.sh:2:9:warning:In POSIX sh, set option pipefail is undefined. [SC3040](https://github.com/koalaman/shellcheck/wiki/SC3040)

API_ENDPOINT="${INPUT_CUSTOM_API_ENDPOINT}"
if [ -z "${INPUT_CUSTOM_API_ENDPOINT}" ]; then
Expand All @@ -14,7 +14,7 @@
cd "${GITHUB_WORKSPACE}" || exit
fi

git config --global --add safe.directory $GITHUB_WORKSPACE

Check warning on line 17 in entrypoint.sh

View workflow job for this annotation

GitHub Actions / runner / shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./entrypoint.sh:17:42:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

Check failure on line 17 in entrypoint.sh

View workflow job for this annotation

GitHub Actions / runner / shellcheck

[shellcheck (suggestion)] reported by reviewdog 🐶 Raw Output: entrypoint.sh:17:-git config --global --add safe.directory $GITHUB_WORKSPACE entrypoint.sh:17:+git config --global --add safe.directory "$GITHUB_WORKSPACE"

# https://languagetool.org/http-api/swagger-ui/#!/default/post_check
DATA="language=${INPUT_LANGUAGE}"
Expand All @@ -36,7 +36,7 @@

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

Check warning on line 39 in entrypoint.sh

View workflow job for this annotation

GitHub Actions / runner / shellcheck

[shellcheck] reported by reviewdog 🐶 Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086) Raw Output: ./entrypoint.sh:39:32:info:Double quote to prevent globbing and word splitting. [SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086)

Check failure on line 39 in entrypoint.sh

View workflow job for this annotation

GitHub Actions / runner / shellcheck

[shellcheck (suggestion)] reported by reviewdog 🐶 Raw Output: entrypoint.sh:39:-FILES="$(git ls-files | ghglob ${INPUT_PATTERNS})" entrypoint.sh:39:+FILES="$(git ls-files | ghglob "${INPUT_PATTERNS}")"
set +o noglob

run_langtool() {
Expand All @@ -45,7 +45,7 @@
curl --silent \
--request POST \
--data "${DATA}" \
--data-urlencode "text=$(cat "${FILE}")" \
--data-urlencode "text@${FILE}" \
"${API_ENDPOINT}/v2/check" | \
FILE="${FILE}" tmpl /langtool.tmpl
done
Expand Down