errata-ai / vale-action

:octocat: The official GitHub Action for Vale -- install, manage, and run Vale with ease.
MIT License
191 stars 44 forks source link

Workflow logs runtime error and the workflow passes without running vale #121

Open l0kal opened 3 months ago

l0kal commented 3 months ago

My .vale.ini:

StylesPath = .github/styles
MinAlertLevel = error
Packages = https://github.com/extenda/<private_repo>/Extenda.zip
Vocab = Extenda
[formats]
ts=js
[*.{md,txt}]
BasedOnStyles = Google, Extenda

My workflow:

name: Vale PR lint
on:
  pull_request

jobs:
  vale-pr-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Lint with Vale
        uses: errata-ai/vale-action@reviewdog
        with:
          fail_on_error: true
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

My package: Extenda.zip

My workflow result:

Run errata-ai/vale-action@v2.1.0
  with:
    fail_on_error: true
    version: latest
    files: all
    debug: false
    reporter: github-pr-annotations
    level: error
    filter_mode: added
    token: ***
  env:
    GITHUB_TOKEN: ***
/usr/bin/pip install docutils
Defaulting to user installation because normal site-packages is not writeable
Collecting docutils
  Downloading docutils-0.[2](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:2)0.1-py[3](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:3)-none-any.whl (572 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 572.7/572.7 KB 8.2 MB/s eta 0:00:00
Installing collected packages: docutils
Successfully installed docutils-0.20.1
/usr/bin/gem install asciidoctor --user-install
WARNING:  You don't have /home/runner/.local/share/gem/ruby/3.0.0/bin in your PATH,
      gem executables will not run.
Successfully installed asciidoctor-2.0.21
Parsing documentation for asciidoctor-2.0.21
Installing ri documentation for asciidoctor-2.0.21
Done installing documentation for asciidoctor after 2 seconds
1 gem installed
Installing Vale version 'latest' ...
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/3[4](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:4)7[5](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:5)a35[6](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:6)-[7](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:7)43e-4a35-9fbe-ce22c6[8](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:8)5f8df
Installed version '3.2.1' into '/home/runner/vale'.
Installing ReviewDog version '0.17.0' ...
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/bac3[9](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:9)828-1fa9-4eb4-b439-ddf44427b97a
Installed reviewdog from 'https://github.com/reviewdog/reviewdog/releases/download/v0.17.0/reviewdog_0.17.0_Linux_x86_64.tar.gz' into '/home/runner/reviewdog'.
/home/runner/vale sync
25l
Syncing 1 package(s) to '/home/runner/.local/share/vale/styles' [0/1]    0% | 0s

 SUCCESS  Downloaded package 'Extenda'

Syncing 1 package(s) to '/home/runner/.local/share/vale/styles' [0/1]    0% | 0s
Syncing 1 package(s) to '/home/runner/.local/share/vale/styles' [1/1]  [10](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:10)0% | 0s
Syncing 1 package(s) to '/home/runner/.local/share/vale/styles' [1/1]  100% | 0s25h
Running vale with reviewdog 🐶 ...
  /home/runner/vale --output=/home/runner/work/_actions/errata-ai/vale-action/v2.1.0/lib/rdjsonl.tmpl .
  E100 [NewE[20](https://github.com/extenda/engineering-iam-common/actions/runs/8153540079/job/22285140017#step:3:21)1] Runtime error

  The path '/home/runner/work/engineering-iam-common/engineering-iam-common/.github/styles' does not exist.

  Execution stopped with code 1.
  /home/runner/reviewdog -f=rdjsonl -name=vale -reporter=github-pr-annotations -fail-on-error=true -filter-mode=added -level=info
  reviewdog: Reporting results for "vale"
  reviewdog: No results found for "vale". 0 results found outside diff.

It says the .github/styles directory does not exist, but it should not need to based on the documentation where it states that the styles folder should be put in the .gitignore file. Running vale sync and vale . works like a charm with the package. Any suggestions?

CollierCZ commented 1 month ago

It should work if you pass the config file explicitly, like in this run. Note your zip file doesn't have the right structure for the latest Vale version. But passing the config before the sync makes sure the StylesPath is recognized.

l0kal commented 1 day ago

@CollierCZ, thank you for replying. I tried your suggestion and it seems it fixed the initial error. Now I have an issue with the package. As you pointed out, it is not in the correct format. I cannot find proper documentation on creating a correct style zip. Would you be able to tell me how my package is wrong or point me in the right direction?

My last GHA run:


/usr/bin/pip install docutils
Defaulting to user installation because normal site-packages is not writeable
Collecting docutils
  Downloading docutils-0.21.2-py3-none-any.whl (587 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 587.4/587.4 KB 8.9 MB/s eta 0:00:00
Installing collected packages: docutils
Successfully installed docutils-0.21.2
/usr/bin/gem install asciidoctor --user-install
WARNING:  You don't have /home/runner/.local/share/gem/ruby/3.0.0/bin in your PATH,
      gem executables will not run.
Successfully installed asciidoctor-2.0.23
Parsing documentation for asciidoctor-2.0.23
Installing ri documentation for asciidoctor-2.0.23
Done installing documentation for asciidoctor after 1 seconds
1 gem installed
Installing Vale version 'latest' ...
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/3f70ae9d-f099-4de0-af36-52c471a95de2
Installed version '3.6.0' into '/home/runner/vale'.
Installing ReviewDog version '0.[17](https://github.com/extenda/engineering-iam-common/actions/runs/9691950069/job/26744355743#step:3:18).0' ...
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/b8dcd540-68b4-4e3b-b5fb-fd5d3726d076
Installed reviewdog from 'https://github.com/reviewdog/reviewdog/releases/download/v0.17.0/reviewdog_0.17.0_Linux_x86_64.tar.gz' into '/home/runner/reviewdog'.
/home/runner/vale --config=.vale.ini sync
25l
 [0/1] ██████████████████████████████████████████████████████████████   0% | 0s
Syncing Extenda [0/1] ███████████████████████████████████████████████   0% | 0s
Syncing Extenda [1/1] ████████████████████████████████████████████████ 100% | 0s
Syncing Extenda [1/1] ████████████████████████████████████████████████ 100% | 0s[25](https://github.com/extenda/engineering-iam-common/actions/runs/9691950069/job/26744355743#step:3:26)h
 SUCCESS  Synced 1 package(s) to '.github/styles'.
Running vale with reviewdog 🐶 ...
  /home/runner/vale --output=/home/runner/work/_actions/errata-ai/vale-action/reviewdog/lib/rdjsonl.tmpl --config=.vale.ini .
  E100 [vocab] Runtime error

  'config/vocabularies/Extenda' directory does not exist

  Execution stopped with code 1.
  /home/runner/reviewdog -f=rdjsonl -name=vale -reporter=github-pr-annotations -fail-on-error=true -filter-mode=added -level=info
  reviewdog: this is not PullRequest build.```