reviewdog / action-remark-lint

Run remark-lint with Reviewdog :dog:
https://github.com/reviewdog/reviewdog
MIT License
5 stars 9 forks source link

Error: Cannot parse file `.remarkrc.yaml` #44

Closed asbjornu closed 3 years ago

asbjornu commented 3 years ago

I'm pretty sure it's not action-remark-lint throwing this error, but it's strange because running remark --rc-path .remarkrc.yaml . locally does not yield any errors. However, on GitHub Actions, action-remark-lint throws the following error:

Error: Cannot parse file `.remarkrc.yaml`

Any ideas what may be causing this?

rickstaa commented 3 years ago

@asbjornu My first though would be that for some reason the .remarkrc.yaml file is not copied or mapped to the docker container. I however did not yet have the time to investigate this issue.

Maybe inspecting the base Dockerfile gives us more information. Maybe @prologic can share the recipe of the docker container that he used when creating this action.

prologic/remark-lint:latest
asbjornu commented 3 years ago

Thanks for the pointer, that sounds like a very plausible explanation @rickstaa.

rickstaa commented 3 years ago

@asbjornu I think I found the Docker recipe. You can check it out here. I'm not fully sure which files are added to the container, since not the filename but what appears to be the hash is shown.

Nevertheless, the github-actions documentation states that the current GITHUB_WORKSPACE should automatiicaly be mounted to the container. In that case, remark-lint should be able to find the .remarkrc.yaml file. Maybe there is some command in the container recipe that breaks this behaviour.

Is it maybe an idea to drop the dependence on prologic/remark-lint:latest and recreate the Dockterfile from scratch? We can then it on FROM alphine (see https://itnext.io/lightweight-and-performance-dockerfile-for-node-js-ec9eed3c5aef) or FROM node:current-alpine. Most other Reviewdog actions that use npm are based on the latter (e.g. https://github.com/reviewdog/action-coffeelint/blob/master/Dockerfile, https://github.com/reviewdog/action-eclint). I think this both has the benefit that we can specify the npm version, and it also makes errors like this easier to debug?

asbjornu commented 3 years ago

I agree that creating a new Dockerfile published under the reviewdog organization would be better.