action-languagetool icon indicating copy to clipboard operation
action-languagetool copied to clipboard

Argument list too long occurred when the file is exceed the limit.

Open kevindiu opened this issue 3 years ago • 1 comments

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

kevindiu avatar Sep 30 '21 06:09 kevindiu

+1

fmorett avatar Aug 25 '23 09:08 fmorett