Usage with nektos/act
Opened this issue ยท 2 comments
When using nektos/act to run the action locally in a container environment, the action fails to find any files to lint and reports a success. I tried using a .sh script to call cspell .
instead of the action and the problem seems to persist. Attaching the logs I have from act. The symptoms are similar to #187 #182
[main/spellcheck ] ๐ Start image=catthehacker/ubuntu:act-latest
[main/spellcheck ] ๐ณ docker pull image=catthehacker/ubuntu:act-latest platform=linux/amd64 username= forcePull=true
[main/spellcheck ] ๐ณ docker create image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[main/spellcheck ] ๐ณ docker run image=catthehacker/ubuntu:act-latest platform=linux/amd64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[main/spellcheck ] โ git clone 'https://github.com/streetsidesoftware/cspell-action' # ref=v6.4.0
[main/spellcheck ] โญ Run Main Checkout
[main/spellcheck ] ๐ณ docker cp src=/home/vacation/Desktop/tcodes0-go/. dst=/home/vacation/Desktop/tcodes0-go
[main/spellcheck ] โ
Success - Main Checkout
[main/spellcheck ] โญ Run Main Cspell
[main/spellcheck ] ๐ณ docker cp src=/home/vacation/.cache/act/streetsidesoftware-cspell-action@v6.4.0/ dst=/var/run/act/actions/streetsidesoftware-cspell-action@v6.4.0/
[main/spellcheck ] ๐ณ docker exec cmd=[node /var/run/act/actions/streetsidesoftware-cspell-action@v6.4.0/action/lib/main_root.cjs] user= workdir=
[main/spellcheck ] | cspell-action
[main/spellcheck ] | Push
[main/spellcheck ] | Files checked: 0, Issues found: 0 in 0 files.
[main/spellcheck ] | Done.
[main/spellcheck ] โ
Success - Main Cspell
[main/spellcheck ] โ ::set-output:: number_of_files_with_issues=0
[main/spellcheck ] โ ::set-output:: files_with_issues=[]
[main/spellcheck ] โ ::set-output:: result={"success":true,"number_of_issues":0,"number_of_files_checked":0,"files_with_issues":[]}
[main/spellcheck ] โ ::set-output:: success=true
[main/spellcheck ] โ ::set-output:: number_of_files_checked=0
[main/spellcheck ] โ ::set-output:: number_of_issues=0
[main/spellcheck ] Cleaning up container for job spellcheck
[main/spellcheck ] ๐ Job succeeded
happy to close/move if this is not related to the action but cspell itself.
Please include a copy of the workflow.
I have not tried nektos/act
, but I will check it out.
Since it doesn't think any files have changed -- Files checked: 0, Issues found: 0 in 0 files.
-- it doesn't think it has anything to do.
I'm guessing you need to set incremental_files_only
to false
, since the action is expecting the GitHub workflow to tell it what files have changed.
What happens when you run cspell .
locally?
Since this hasn't been updated by the author recently, I will add that I was facing the same issue by which act
cli was not reporting any files checked. In my case, I was experiencing the issue with the act push
command. I have resolved my issue by updating my configuration to:
...
- name: Check spelling
uses: streetsidesoftware/cspell-action@v6
with:
incremental_files_only: false
...
No files reported with incremental_files_only
configuration not set
[Build, Test, and Lint/build] โ
Success - Main Check spelling
[Build, Test, and Lint/build] โ ::set-output:: files_with_issues=[]
[Build, Test, and Lint/build] โ ::set-output:: result={"success":true,"errors":0,"number_of_issues":0,"number_of_files_checked":0,"files_with_issues":[]}
[Build, Test, and Lint/build] โ ::set-output:: success=true
[Build, Test, and Lint/build] โ ::set-output:: errors=0
[Build, Test, and Lint/build] โ ::set-output:: number_of_files_checked=0
[Build, Test, and Lint/build] โ ::set-output:: number_of_issues=0
[Build, Test, and Lint/build] โ ::set-output:: number_of_files_with_issues=0
(Expected) Failure when incremental_files_only
configuration set to false
Build, Test, and Lint/build] โ ::error::4 spelling issues found in 4 of the 17 files checked.
| Done.
[Build, Test, and Lint/build] โ Failure - Main Check spelling
[Build, Test, and Lint/build] โ ::set-output:: errors=0
[Build, Test, and Lint/build] โ ::set-output:: number_of_files_checked=17
[Build, Test, and Lint/build] โ ::set-output:: number_of_issues=4
[Build, Test, and Lint/build] โ ::set-output:: number_of_files_with_issues=4