reviewdog / action-remark-lint

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

Advice needed for github action #92

Open jharrell opened 6 months ago

jharrell commented 6 months ago

Hi there! I apologize for the vague title.

I'm quite new to the remark ecosystem and am trying to implement this GitHub Action into the prisma docs repo here: https://github.com/prisma/docs/pull/5956

I've set up the action like so:

  remark-lint:
    name: runner / remark-lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18
      - name: install remark presets
        run: npm install remark-lint-no-dead-urls
        shell: bash
      - name: remark-lint
        uses: reviewdog/action-remark-lint@v5
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          reporter: github-pr-check
          remark_args: '-qf -e=md,mdx --use=remark-mdx --use remark-frontmatter --use remark-gfm --use remark-lint-no-dead-urls=skipLocalhost:true,skipUrlPatterns:["https://www.notion.so/prismaio","https://www.prisma.io/docs","https://dash.cloudflare.com","https://www.cloudflare.com"]'

I've been having a bit of trouble, with errors like the following:

1:1  error  TypeError: Cannot read properties of undefined (reading 'inTable')
1:1  error  TypeError: Cannot read properties of undefined (reading 'mdxJsxTagStack')

I've done some digging and it looks like this might have something to do with mismatched versions of packages within the remark ecosystem. So, I also tried running remark-cli directly via a github action like so

       - name: run remark-cli
         run: |
           npx remark-cli . -qf -e=md,mdx --use=remark-mdx --use remark-frontmatter --use remark-gfm \
           --use 'remark-lint-no-dead-urls=skipLocalhost:true,skipUrlPatterns:["https://www.notion.so/prismaio","https://www.prisma.io/docs","https://dash.cloudflare.com","https://www.cloudflare.com"]'

and everything worked like I would expect.

Is there anything horribly obvious I'm missing? Any recommendations you'd have?

Thank you for your time!