action-languagetool
action-languagetool copied to clipboard
Argument list too long occurred when the file is exceed the limit.
In Vald project, we are using reviewdog to review our .md
and .toml
files.
https://github.com/vdaas/vald/blob/master/.github/workflows/reviewdog-markdown.yml
But when we are using it, an error occurred and the CI failed with the following error message.
...
Checking .github/chatops_commands.md...
2021-09-28 07:34:09.490 +0000 INFO org.languagetool.server.TextChecker Check done: 365 chars, en-US, requestId: null, #5, null, 0 matches, 84ms, agent:-, sent, q:0, h:1, dH:1, m:all
Checking CHANGELOG.md...
/entrypoint.sh: line 43: curl: Argument list too long
tmpl: EOF
https://github.com/vdaas/vald/pull/1450/checks?check_run_id=3751663477
As the error message shown, the error is caused by entrypoint.sh file. https://github.com/reviewdog/action-languagetool/blob/master/entrypoint.sh#L43-L48
I did some research about it, and it seems that the entire file content is sent from command line option.
--data-urlencode "text=$(cat "${FILE}")" \
I think we can improve it by using @file
instead of cat $FILE
. e.g.
--data-urlencode "text=@"${FILE}"" \
Ref: https://stackoverflow.com/questions/54090784/curl-argument-list-too-long
+1