Git Product home page Git Product logo

vale-action's Introduction

GitHub Actions + Vale

:octocat: The official GitHub Action for Vale -- install, manage, and run Vale with ease.

A demo screenshot.

Usage

Add the following (or similar) to one of your .github/workflows files:

name: reviewdog
on: [pull_request]

jobs:
  vale:
    name: runner / vale
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: errata-ai/vale-action@reviewdog

Repository Structure

The recommended repository structure makes use of the existing .github directory to hold all of our Vale-related resources:

.github
├── styles
│   └── vocab.txt
└── workflows
    └── main.yml
.vale.ini
...

Where styles represents your StylesPath. The top-level .vale.ini file should reference this directory:

StylesPath = .github/styles
MinAlertLevel = suggestion

[*.md]
BasedOnStyles = Vale

Inputs

You can further customize the linting processing by providing one of the following optional inputs.

To add an input, edit your workflow file and add the with key to the uses block. For example:

- uses: errata-ai/vale-action@reviewdog
  with:
    version: 2.17.0

version (default: latest)

NOTE: The provided version must be >= 2.16.0.

Specify the Vale CLI version to use.

with:
  version: 2.17.0

files (default: all)

files specifies where Vale will look for files to lint.

with:
  files: path/to/lint

You can supply this value one of four ways:

  • files: all (default): The repo's root directory; equivalent to calling vale ..

  • files: path/to/lint: A single file or directory; equivalent to calling vale path/to/lint.

  • files: '["input1", "input2"]': A JSON-formatted list of file or directory arguments; equivalent to calling vale input1 input2.

  • files: 'input1,input2': A character-delimited list of files. The character is determined by the input value separator:

    with:
      separator: ","

reporter (default: github-pr-check)

Set the reporter type.

with:
  # github-pr-check, github-pr-review, github-check
  reporter: github-pr-check

fail_on_error (default: false)

By default, reviewdog will return exit code 0 even if it finds errors. If fail_on_error is enabled, reviewdog exits with 1 when at least one error was reported.

with:
  fail_on_error: true

filter_mode (default: added)

Set the filter mode for reviewdog.

with:
  # added, diff_context, file, nofilter
  filter_mode: nofilter

vale_flags (default: "")

Space-delimited list of flags for the Vale CLI. To see a full list of available flags, run vale -h.

Note that flags should not include quotes. So while --glob='*.txt' works with Vale, it does not work with this action. Use the flag without quotes, as in the following example:

with:
  vale_flags: "--glob=*.txt"

token (default: secrets.GITHUB_TOKEN)

The GitHub token to use.

with:
  token: ${{secrets.VALE_GITHUB_TOKEN}}

vale-action's People

Contributors

alexfauquette avatar benoitf avatar chrischinchilla avatar colliercz avatar daniele-pini avatar dcousineau avatar dependabot[bot] avatar erezrokah avatar ezzatron avatar haru52 avatar jdkato avatar joelhawksley avatar lgtm-migrator avatar lithammer avatar makew0rld avatar mheap avatar pierrebeitz avatar themr0c avatar wildmanonline avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vale-action's Issues

Failed executions in scheduled runs

When running vale in a cron job, the execution fails.
My example includes a custom runner which works in other contexts (push, pr).

on:
  schedule:
    - cron: "0 0 * * 1-5"

jobs:
  deploy:
    runs-on: ["nodejs-16"]
    steps:
    - name: Checkout
      uses: actions/checkout@master
    - name: Vale
      uses: errata-ai/vale-action@reviewdog
      with:
        reporter: github-check
      env:
        GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Installing Vale version 'latest' ...
/bin/tar xz --overwrite -C /github/home -f /runner/_work/_temp/1fb8e340-4ab8-436b-bc5c-87139bb85213
Installed version '2.17.0' into '/github/home/vale'.
/github/home/vale sync
Running vale with reviewdog 🐶 ...
  /github/home/vale --output=/lib/rdjsonl.tmpl .
  /bin/reviewdog -f=rdjsonl -name=vale -reporter=github-check -fail-on-error=false -filter-mode=added -level=error
  reviewdog: post failed for vale: failed to create check: POST https://api.github.com/repos///check-runs: 404 Not Found []
Error: reviewdog exited with status code: 1

See reviewdog/reviewdog#832

Conclusion is success despite ERROR

Hi! Given the following settings in .vale.ini:

Packages = Microsoft

StylesPath = .vale/styles

MinAlertLevel = suggestion

[*.md]
BasedOnStyles = Vale, Microsoft

And the GitHub workflow action:

---                                                                             
name: Linting with Vale on pull request                                         
 on:                                                                             
   - pull_request_target                                                         
 jobs:                                                                           
   vale:                                                                         
     name: Linting with Vale                                                     
     runs-on: ubuntu-latest                                                      
     steps:                                                                      
       - name: Checkout                                                          
         uses: actions/[email protected]                                           
       - name: Vale Linter                                                       
         uses: errata-ai/vale-action@reviewdog                                   
         with:                                                                   
           fail_on_error: true                                                   
         env:                                                                    
           GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 

I fail to understand why the conclusion of running Vale with reviewdog is conclusion=success

Running vale with reviewdog 🐶 ...
  /github/home/vale --output=/lib/rdjsonl.tmpl .
  {"message": "[Microsoft.Adverbs] Consider removing 'very'.", "location": {"path": "docs/foo.md", "range": {"start": {"line": 1, "column": 5}}}, "severity": "WARNING"}
  {"message": "[Vale.Spelling] Did you really mean 'herrre'?", "location": {"path": "docs/foo.md", "range": {"start": {"line": 3, "column": 21}}}, "severity": "ERROR"}
  /bin/reviewdog -f=rdjsonl -name=vale -reporter=github-pr-check -fail-on-error=true -filter-mode=added -level=error
  2022/10/12 13:11:25 [vale] reported: https://github.com/volvo-cars/vale-test/runs/8846666662 (conclusion=success)

Any help debugging this issue is much appreciated 🙏🏼

Nice-to-have: Allow hooking to "pull_request" event instead of "push"

Since we only need the writing style check when a branch goes into PR review we'd be happy to save some github action runtime contingent by hooking the vale checks only to the pull_request github event (which defaults to opening a PR and synchronize, which is when a new head commit is pushed). That way it would run only on the branches that we need it to run.

I tried and it started (including logging the number of issues found), but the checks were not annotated to code. No errors on the logging output, too so I can't provide details here.

Really just a nice to have but if it works I think it's a better fit to typical workflows.

Vale action output showing up under different workflow

I'm trying to add the vale-action to the Stoplight docs repository (this PR), and for some reason the reviewdog output with the annotations for the vale-action is being added under another workflow we have in our repo for checking markdown links:

Screen Shot 2022-07-11 at 3 30 50 PM

Any ideas on why that might be happening? I tried removing the markdown-link-check workflow to see what happens, and that makes the reviewdog vale report show up correctly under the vale action.

Refine how `onlyAnnotateModifiedLines` should work

It's not just the last commit; it's every commit individually.

It seems like you'd like it to be every commit collectively. In other words,
every commit would also include all annotations from all previous commits.

This is possible, but less straightforward since the it only applies to PRs (whereas the the current functionality can apply to pushes too) and the content of a line can change between commits.

For now, I think just using files: __onlyModified is closer to what you want. But we can discuss this more, although I think I'll move it to a new issue.

Originally posted by @jdkato in #27 (comment)

v2.0.0 re-write

With the release of v2.16.0 of Vale, the CLI now has built-in (and improved) support for the action's config-handling features.

There's also been a number of changes to GitHub Actions since this one was created, so I figure it's a good time to think about a re-write:

  • Config handling should be managed in .vale.ini.
  • The version of Vale should be an action parameter.
  • Changed files logic should be offloaded to reviewdog (#32)
  • CLI options, such as --glob, should be supported (#37).
  • Better control of how/when the action fails (#26)
  • Support opt-in dependencies (#51)

maybe more ...

Update vale

This action only uses Vale v2.2.0, but v2.3.1 is out. Would it be possible to update Vale, so that new features like vocab can be used? This would also require updating the jdkato/vale docker container.

Vale configuration in GitHub Actions for asciidoctor files

I am trying to get the Vale GitHub Action working for my book that consists of multiple Asciidoctor files.

So far I have the action working, but I am not sure the official action includes asciidoctor, because it throws error messages on lines in source code blocks.

I would also like for it to use an en_GB dictionary.

These are the configuration files I've used.
.vale.ini

StylesPath = .github/styles
MinAlertLevel = suggestion

[./*.md]
BasedOnStyles = Vale

[book/*.adoc]
BasedOnStyles = Vale

.github/vale-linter.yml

name: Linting
on: [push]

jobs:
  prose:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master

      - name: Vale
        uses: errata-ai/[email protected]
        with:
          styles: |
            Vale
            https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
            https://github.com/errata-ai/proselint/releases/latest/download/proselint.zip
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

How can I tell it to ignore the source code blocks and use an en_GB dictionary?

workaround for PR from forked repo fail with onlyAnnotateModifiedLines option

Hi, I encounter a problem with using the workaround for PR from a forked repo.

When setting onlyAnnotateModifiedLines: true I get no error added to the PR and the action display a warning 'Unrecognized event: workflow_run' and no comment is added to the modified lines.

  • If I remove this option I obtain comments on unmodified lines
  • If I run the action with pull_request event instead of workflow_run it works fine

I found that the error message comes from getCommits message which seems to support only support pull_request and push events.


If it can help, this are the workflow files

name: Linting

on:
  workflow_run:
    workflows: [PR check]
    types:
      - completed
  workflow_dispatch:

jobs:
  prose:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      # get the SHA from workflow triggered by pull_request
      - name: Open sha file
        uses: dawidd6/action-download-artifact@v2
        with:
          workflow: ${{ github.event.workflow_run.workflow_id }}
          name: pull-request-sha
      - name: Grab pull request sha1
        run: |
          pr_sha=`cat pr-sha.txt`
          echo "PR_SHA=$pr_sha" >> $GITHUB_ENV

      - name: Vale
        uses: errata-ai/vale-action@master
        with:
          styles: |
            https://github.com/errata-ai/Google/releases/latest/download/Google.zip
            https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
            
          onlyAnnotateModifiedLines: true

          files: docs/data
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          OVERRIDE_GITHUB_SHA: ${{env.PR_SHA}}

Unable to create annotations; printing Vale alerts instead for PRs

I'm using Vale on my documentation repository at https://github.com/vendrhub/vendr-documentation/ and all seems to work fine when I make commits to the core repository myself, however, for people submitting PR's it appears that Vale fails to create annotations and instead just prints the errors out to the console instead.

https://github.com/vendrhub/vendr-documentation/pull/14/checks?check_run_id=632785607

Is there something amiss in my config as to why this is the case?

/Matt

Action failing even without errors reported by Vale

I'm facing a scenario on which vale-action is failing the lint step thus never reporting the detailed output of suggestions and warnings.

While attempting to create a use case to reproduce the issue, I found the exact same issue on this repository, on actions executed on the 25th of October 2021:

  1. Failed, no errors reported by Vale
Vale: Found 10 suggestion(s), 13 warning(s), and 0 error(s).

https://github.com/errata-ai/vale-action/runs/3991245834?check_suite_focus=true

  1. Succeeded, same commit hash as previous action that failed, no errors reported by Vale
Vale: Found 10 suggestion(s), 13 warning(s), and 0 error(s).

https://github.com/errata-ai/vale-action/runs/3991248374?check_suite_focus=true

Questions:

  1. What's the difference between those two action runs?
  2. Why did the first one failed?
  3. Why did the second one passed?

Linter unable to create annotations; printing Vale alerts instead.

This is my workflow:

name: Linter as style guide

on:
  pull_request:

permissions:
  actions: read
  contents: read
  pull-requests: write

jobs:
  linter:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f

      - name: Vale
        uses: errata-ai/vale-action@cb5ab4acdaf3169b1b5e5b4785d844aaea6366a0
        with:
          onlyAnnotateModifiedLines: true
        env:
          # Required, set by GitHub actions automatically:
          # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

My .vale.ini


# suggestion, warning or error
MinAlertLevel = warning 

Vocab = Docs

[*.md]
BasedOnStyles = Vale,Vocab

TokenIgnores = (\`{1}((.|\n)*?)\`{1}), \
               \[([^\[]+)\](\(.*\)), \
               {%.*?%}, \ 
               {{.*?}}, \  
               (.|\/|-)?github(\/|-)?, \
               (\`{3}((.|\n)*?)\`{3})
StylesPath = styles

# suggestion, warning or error
MinAlertLevel = warning 

Vocab = Docs

[*.md]
BasedOnStyles = Vale,Vocab

TokenIgnores = (\`{1}((.|\n)*?)\`{1}), \
               \[([^\[]+)\](\(.*\)), \
               {%.*?%}, \ 
               {{.*?}}, \  
               (.|\/|-)?github(\/|-)?, \
               (\`{3}((.|\n)*?)\`{3})

This posting annotations correctly until last week. I noticed this happening only this week.

image

Mention the option to lint added files in addition to modified files

First, thank you for the great tool!

The readme describes how to lint modified files in a PR, using the file-changes action and files: ${{ steps.file_changes.outputs.files_modified }}. That omits files added in a PR, as far as I understand.

At least for us, this causes the lint process to stall, and eventually timeout (after 5 hours), for some reason, if a PR only adds files and doesn’t modify any existing ones.

Something like is probably a good idea to add to the readme:

files: '${{ steps.file_changes.outputs.files_modified }} ${{ steps.file_changes.outputs.files_added }}'

Update: well, the above doesn’t actually work, the path it produces is not valid. Not sure how to combine the two arrays together. Using steps.file_changes.outputs.files doesn’t feel correct either, as it contains removed files.

Vale update

Hey there, could there maybe be a way to specify which version of Vale to use? Currently the action uses 2.10.3 while the latest is 2.15.0, which has quite a few changes and means I have different results in my CI vs locally.

How to check all files of a filetype but exclude some

So I have a directory structure that's a bit like this, where basically in the include directory there are many subdirectories all including *.tex files:

.
├── README.md
├── background.tex
├── include
│   ├── background
│   │   ├── cosmology
│   │   │   ├── geometry_dynamics
│   │   │   │   ├── dynamics.tex
├── letter_convolution.tex
├── letter_convolution_editor_response.tex
├── letter_convolution_referee_response.tex
├── note.tex
├── paper_slepian_manifolds.tex
├── paper_slepian_wavelets.tex
├── poster.tex
├── presentation.tex
├── test.md
└── thesis_plan.tex

what I want to do is to check all *.tex files except the two of the form letter_convolution_*.tex (as they're full of issues I'm not going to fix).

My .vale.ini file looks like:

StylesPath = .vale-styles

[*.tex]
BasedOnStyles=vale

On the command line I know I can achieve this by doing vale --glob='!letter_convolution_*' *.

How do I do it with the extension? I've tried adjusting the [...] in .vale.ini but cannot get it to work. Is there a config option within the CI itself?

Vale workflow does not fail even if errors are present

vale reports: Vale: Found 0 suggestion(s), 0 warning(s), and 26 error(s). but the action finishes without reporting an error. Is this the expected behavior?

2019-12-12T16:27:27.9607635Z ##[group]Run errata-ai/[email protected]
2019-12-12T16:27:27.9607806Z with:
2019-12-12T16:27:27.9608047Z   styles: https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
https://github.com/errata-ai/Google/releases/latest/download/Google.zip

2019-12-12T16:27:27.9608301Z   config: https://gist.githubusercontent.com/thomas-moulard/81e4fc260bddeb4149838b884ba86701/raw/cf331fe24d43fc2f02be4b40c5e83051a9e62130/vale.ini
2019-12-12T16:27:27.9608479Z   files: all
2019-12-12T16:27:27.9608595Z env:
2019-12-12T16:27:27.9608820Z   GITHUB_TOKEN: ***
2019-12-12T16:27:27.9608938Z ##[endgroup]
2019-12-12T16:27:27.9638290Z ##[command]/usr/bin/docker run --name af96b460939e6e3b7641f980748a9c246201f9_842036 --label af96b4 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_STYLES -e INPUT_CONFIG -e INPUT_FILES -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/cross_compile/cross_compile":"/github/workspace" af96b4:60939e6e3b7641f980748a9c246201f9  "https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
https://github.com/errata-ai/Google/releases/latest/download/Google.zip
" "https://gist.githubusercontent.com/thomas-moulard/81e4fc260bddeb4149838b884ba86701/raw/cf331fe24d43fc2f02be4b40c5e83051a9e62130/vale.ini" "all"
2019-12-12T16:27:29.0454385Z (node:1) ExperimentalWarning: The fs.promises API is experimental
2019-12-12T16:27:29.0484285Z [command]/bin/vale -v
2019-12-12T16:27:29.0947523Z vale version v2.0.0-beta.2
2019-12-12T16:27:29.1000699Z Downloading external config 'https://gist.githubusercontent.com/thomas-moulard/81e4fc260bddeb4149838b884ba86701/raw/cf331fe24d43fc2f02be4b40c5e83051a9e62130/vale.ini' ...
2019-12-12T16:27:29.2875148Z Successfully fetched remote config.
2019-12-12T16:27:29.2897208Z Installing style 'write-good' ...
2019-12-12T16:27:29.2919666Z [command]/bin/vale --no-exit --output=JSON --mode-rev-compat --config=/github/workspace/tmp-1b4DHBUaX0VWo.ini install write-good https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
2019-12-12T16:27:29.3360053Z Installing style 'Google' ...
2019-12-12T16:27:29.3360780Z [command]/bin/vale --no-exit --output=JSON --mode-rev-compat --config=/github/workspace/tmp-1b4DHBUaX0VWo.ini install Google https://github.com/errata-ai/Google/releases/latest/download/Google.zip
2019-12-12T16:27:29.3801762Z Vale set-up comeplete; using '--no-exit,--output=JSON,--mode-rev-compat,--config=/github/workspace/tmp-1b4DHBUaX0VWo.ini,.'.
2019-12-12T16:27:29.8125700Z Vale: Found 0 suggestion(s), 0 warning(s), and 26 error(s).
2019-12-12T16:27:30.9211134Z Post job cleanup.
2019-12-12T16:27:31.0285539Z [command]/usr/bin/git version
2019-12-12T16:27:31.0353317Z git version 2.24.0
2019-12-12T16:27:31.0391443Z [command]/usr/bin/git config --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2019-12-12T16:27:31.0427691Z http.https://github.com/.extraheader
2019-12-12T16:27:31.0437506Z [command]/usr/bin/git config --unset-all http.https://github.com/.extraheader
2019-12-12T16:27:31.0532231Z Cleaning up orphan processes

logs | raw logs

Unable to run action - E100 [.vale.ini] Runtime error open : no such file or directory

Hiya,

I'm currently unable to get the action for Vale running. On my own machine I can run Vale fine with the below files using vale --config=".github/.vale.ini" --ext=".md" /local/path/to/repo

Things I've tried:

  • Running the pipeline with the Microsoft and write-good styles not committed to git
  • Changing the stylepath to .github/styles (this then breaks execution on my local machine, as it tries to find .github/.github/styles)

Any pointers as to where I'm going wrong would be much appreciated.

Action file
name: Linting
on:
  pull_request:
    branches:
      - main

jobs:
  prose:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@master

    - name: Vale
      uses: errata-ai/[email protected]
      with:
        # Optional
        styles: |
          https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
          https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
        # Optional
        files: __onlyModified
        debug: true
      env:
        # Required
        GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
.vale.ini file:
StylesPath = .github/styles
MinAlertLevel = warning

Vocab = Documentation

[*.md]
BasedOnStyles = Vale, Microsoft, write-good
write-good.Passive = NO
write-good.E-Prime = NO
Microsoft.We = suggestion
Microsoft.Terms = suggestion
Full output of Vale step
Run errata-ai/[email protected]
  with:
    styles: https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
  https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
  
    files: __onlyModified
    debug: true
    onlyAnnotateModifiedLines: false
  env:
    GITHUB_TOKEN: ***
/usr/bin/docker run --name a33c1460ee904495e49d38f57d5c57d5e75f3_e9d2a1 --label 8a33c1 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_STYLES -e INPUT_FILES -e INPUT_DEBUG -e INPUT_CONFIG -e INPUT_ONLYANNOTATEMODIFIEDLINES -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/es-foundational-docs/es-foundational-docs":"/github/workspace" 8a33c1:460ee904495e49d38f57d5c57d5e75f3  "https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
" "" "__onlyModified" "false" "true"
Using Vale v2.8.2
Installing style 'Microsoft' ...
/bin/vale install Microsoft https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
E100 [.vale.ini] Runtime error

open : no such file or directory

Execution stopped with code 1.
Error: The process '/bin/vale' failed with exit code 2
Folder structure

📦es-foundational-docs
┣ 📂.github
┃ ┣ 📂styles
┃ ┃ ┣ 📂Microsoft
┃ ┃ ┃ ┣ 📜AMPM.yml
┃ ┃ ┃ ┣ 📜 ... Various other files ...
┃ ┃ ┃ ┗ 📜meta.json
┃ ┃ ┣ 📂Vocab
┃ ┃ ┃ ┗ 📂Documentation
┃ ┃ ┃ ┃ ┣ 📜accept.txt
┃ ┃ ┃ ┃ ┗ 📜reject.txt
┃ ┃ ┗ 📂write-good
┃ ┃ ┃ ┣ 📜Cliches.yml
┃ ┃ ┃ ┣ 📜 ... Various other files ...
┃ ┃ ┃ ┗ 📜meta.json
┃ ┣ 📂workflows
┃ ┃ ┗ 📜main.yaml
┃ ┗ 📜.vale.ini
┣ 📂Postmortems
┃ ┣ 📂3553877
┃ ┃ ┗ 📜Postmortem.md
┃ ┣ 📂TEMPLATE
┃ ┃ ┣ 📜README.md
┃ ┃ ┗ 📜postmortem-template.md
┃ ┗ 📜README.md
┗ 📜README.md

How to download all generated annotations at once?

I am checking out this linter for the nest-simulator documentation, but with the default configuration file, I get a lot of issues that should be ignored (apparently, mainly words that are not in the dictionary but were intended to be used that way). I want to understand/search through some log of issues. How can I download a log file that contains all issues found?

Started failing without error message

Hi,
the recent days saw a series of vale releases and action container changes so it's hard to define for me which change introduced that our github action runs are now failing without error message (only response code 2)

we did see a different error in the last days, then updated all our config to be valid for the latest vale versions, tested the config with locally installed vale. Now there is no error specific error message any more but the action still fails.

config:

      - name: Writing style (generate GitHub comments)
        uses: errata-ai/[email protected]
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
        with:
          files: '["websites", "packages/topics"]'
          config: https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini
          debug: true

output:

2021-01-13T11:17:39.5324216Z ##[group]Run errata-ai/[email protected]
2021-01-13T11:17:39.5324657Z with:
2021-01-13T11:17:39.5325044Z   files: ["websites", "packages/topics"]
2021-01-13T11:17:39.5326124Z   config: https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini
2021-01-13T11:17:39.5327079Z   debug: true
2021-01-13T11:17:39.5327376Z env:
2021-01-13T11:17:39.5328627Z   GITHUB_TOKEN: ***
2021-01-13T11:17:39.5328969Z ##[endgroup]
2021-01-13T11:17:39.5378480Z ##[command]/usr/bin/docker run --name cc4956a6ecc1c1474f4869be96585e348fa74b_95ecbe --label cc4956 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_FILES -e INPUT_CONFIG -e INPUT_DEBUG -e INPUT_STYLES -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/commercetools-docs/commercetools-docs":"/github/workspace" cc4956:a6ecc1c1474f4869be96585e348fa74b  "" "https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini" "[\"websites\", \"packages/topics\"]" "true"
2021-01-13T11:17:41.6956769Z Using Vale v2.8.0
2021-01-13T11:17:41.6962767Z Downloading external config 'https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini' ...
2021-01-13T11:17:41.8946612Z Successfully fetched remote config.
2021-01-13T11:17:41.8948821Z Vale set-up comeplete; using '--no-exit,--output=JSON,--mode-rev-compat,--config=/github/workspace/tmp-1qiBHu62gEukG.ini,websites,packages/topics'.
2021-01-13T11:17:42.0899618Z ##[error]Command failed with exit code 2: vale --no-exit --output=JSON --mode-rev-compat --config=/github/workspace/tmp-1qiBHu62gEukG.ini websites packages/topics

Do non-builtin styles work?

I was playing with adding the action to a repository, and while any of the inbuilt vale styles worked, nothing else did. So when I looked at the example you have here #1 I'm not actually sure that the non vale styles there work either.

For example:

This will likely be fixed by toolkit/issues/186.

Should flag two write-good warnings, but there are none, even though , as far as I can tell write-good checks should be running.

Action failing without error message now (exit code 2)

Hi,
the recent days saw a series of vale releases and action container changes so it's hard to define for me which change introduced that our github action runs are now failing without error message (only response code 2)

we did see a different error in the last days, then updated all our config to be valid for the latest vale versions, tested the config with locally installed vale. Now there is no error specific error message any more but the action still fails.

config:

      - name: Writing style (generate GitHub comments)
        uses: errata-ai/[email protected]
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
        with:
          files: '["websites", "packages/topics"]'
          config: https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini
          debug: true

output:

2021-01-13T11:17:39.5324216Z ##[group]Run errata-ai/[email protected]
2021-01-13T11:17:39.5324657Z with:
2021-01-13T11:17:39.5325044Z   files: ["websites", "packages/topics"]
2021-01-13T11:17:39.5326124Z   config: https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini
2021-01-13T11:17:39.5327079Z   debug: true
2021-01-13T11:17:39.5327376Z env:
2021-01-13T11:17:39.5328627Z   GITHUB_TOKEN: ***
2021-01-13T11:17:39.5328969Z ##[endgroup]
2021-01-13T11:17:39.5378480Z ##[command]/usr/bin/docker run --name cc4956a6ecc1c1474f4869be96585e348fa74b_95ecbe --label cc4956 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_FILES -e INPUT_CONFIG -e INPUT_DEBUG -e INPUT_STYLES -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/commercetools-docs/commercetools-docs":"/github/workspace" cc4956:a6ecc1c1474f4869be96585e348fa74b  "" "https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini" "[\"websites\", \"packages/topics\"]" "true"
2021-01-13T11:17:41.6956769Z Using Vale v2.8.0
2021-01-13T11:17:41.6962767Z Downloading external config 'https://raw.githubusercontent.com/commercetools/commercetools-docs-kit/master/packages/writing-style/.vale.ini' ...
2021-01-13T11:17:41.8946612Z Successfully fetched remote config.
2021-01-13T11:17:41.8948821Z Vale set-up comeplete; using '--no-exit,--output=JSON,--mode-rev-compat,--config=/github/workspace/tmp-1qiBHu62gEukG.ini,websites,packages/topics'.
2021-01-13T11:17:42.0899618Z ##[error]Command failed with exit code 2: vale --no-exit --output=JSON --mode-rev-compat --config=/github/workspace/tmp-1qiBHu62gEukG.ini websites packages/topics

Empty Vale Report on GitHub but not locally

Hi, I am trying to use the errata-ai/vale-action@reviewdog action on GHE but the output is empty:

image

Running Vale locally with vale --glob='*.{md,txt}' . results in a bunch of expected suggestions/errors in the output report.

The workflow steps for Vale are:

name: lint
on:
  pull_request:
    branches:
      - main
  
jobs:
  vale:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Vale
        uses: errata-ai/vale-action@reviewdog
        with:
          debug: true
          fail_on_error: true
          reporter: github-pr-check
          # added (default), diff_context, file, nofilter
          filter_mode: added
          vale_flags: --glob="*.{md,txt}"

        env:
          # Required, set by GitHub actions automatically:
          # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

The output of the build step is

Run errata-ai/vale-action@reviewdog
/usr/bin/docker run --name e28767c079dabc6d4c2c9503e976582b2fe0_d627cd --label 85e287 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_DEBUG -e INPUT_FAIL_ON_ERROR -e INPUT_REPORTER -e INPUT_FILTER_MODE -e INPUT_VALE_FLAGS -e INPUT_VERSION -e INPUT_FILES -e INPUT_LEVEL -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_RUN_ATTEMPT -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_REF_NAME -e GITHUB_REF_PROTECTED -e GITHUB_REF_TYPE -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e GITHUB_STEP_SUMMARY -e RUNNER_OS -e RUNNER_ARCH -e RUNNER_NAME -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/opt/github-action-runner/_work/_temp/_github_home":"/github/home" -v "/opt/github-action-runner/_work/_temp/_github_workflow":"/github/workflow" -v "/opt/github-action-runner/_work/_temp/_runner_file_commands":"/github/file_commands" -v "/opt/github-action-runner/_work/docs/docs":"/github/workspace" 85e287:67c079dabc6d4c2c9503e976582b2fe0  "latest" "all" "true" "github-pr-check" "true" "error" "added" "--glob=\"*.{md,txt}\""
Installing Vale version 'latest' ...
/bin/tar xz --overwrite -C /github/home -f /opt/github-action-runner/_work/_temp/cbb8a33e-206a-4dbd-83a2-04b7f3d39c9d
Installed version '2.20.[1](.../runs/180368?check_suite_focus=true#step:4:1)' into '/github/home/vale'.
Using Vale 2.20.1
/github/home/vale --glob="*.{md,txt}" sync

Downloading packages [0/6] █                                             0% | 0s
                                                                                
 SUCCESS  Downloaded package 'Google'

Downloading packages [1/6] ████████                                     [17](.../runs/180368?check_suite_focus=true#step:4:17)% | 2s
                                                                                
 SUCCESS  Downloaded package 'proselint'

Downloading packages [2/6] ███████████████                              33% | 3s
                                                                                
 SUCCESS  Downloaded package 'write-good'

Downloading packages [3/6] ██████████████████████                       50% | 4s
                                                                                
 SUCCESS  Downloaded package 'alex'

Downloading packages [4/6] █████████████████████████████                67% | 5s
                                                                                
 SUCCESS  Downloaded package 'Readability'

Downloading packages [5/6] ████████████████████████████████████         83% | 6s
                                                                                
 SUCCESS  Downloaded package 'Joblint'

Downloading packages [6/6] ███████████████████████████████████████████ 100% | 7s
Vale set-up comeplete; using '--output=/lib/rdjsonl.tmpl,--glob="*.{md,txt}",.'.
Running vale with reviewdog 🐶 ...
  /github/home/vale --output=/lib/rdjsonl.tmpl --glob="*.{md,txt}" .
  /bin/reviewdog -f=rdjsonl -name=vale -reporter=github-pr-check -fail-on-error=true -filter-mode=added -level=info
  2022/08/30 12:54:06 [vale] reported: .../runs/[18](.../runs/180368?check_suite_focus=true#step:4:18)0369 (conclusion=success)

Do you have any suggestion what might cause the empty reports or how to debug it?

To me it seems Vale is executed in a directory that contains no content files.

Is there a way to check which path is used to execute vale or to pass the -tee debugging option to reviewdog to debug the issue?

Error: Cannot find module '@actions/http-client'

Hello!
please tell me how to fix this error?

Selection_018

Vale config

name: Vale linting
on: [push]

jobs:
  prose:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master

      - name: Vale
        uses: errata-ai/[email protected]
        with:
          styles: |
            https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
            https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Issue when "Readability" rule is used

When a "Readability" rule is used within a pipeline, i get the following error:

Screen Shot 2021-09-01 at 12 12 50 AM

Screen Shot 2021-09-01 at 12 13 16 AM

The readability rule file is defined below:

extends: readability
message: "Grade level (%s) too high!"
level: warning
grade: 14
metrics:
  # - Flesch-Kincaid
  # - Gunning Fog
  - Coleman-Liau
  # - Automated Readability

It appears when i remove this file, everything works as expected. My config file looks like this:

StylesPath = .github/styles
MinAlertLevel = suggestion

[*.{md,txt}]
BasedOnStyles = Google

Option to only annotate on touched lines

Hi @jdkato and big kudos for the great software you bring to the world!

I recently added this vale-action to an existing repository with hundreds of existing markdown files. To not have this action check all of the repository, we use the trilom/file-changes-action as suggested in the readme, along with some custom code that filters those for files ending in .md (i now wonder if there's an easier way to have vale ignore the other files 🤔).
Whenever someone changes a line in an existing file, vale-action currently produces annotations for the whole file, which gives some members of our organization the feeling that their PR is cluttered and/or hard to review.

i think that's due to

  1. us just starting to use vale and thus not having a configuration that generates as few and meaningful annotations as it could
  2. folks not being used to the suggestions that are made by vale (so sometimes the style of writing might actually need to change to generate fewer annotation)
  3. github not providing a single button to toggle all annotations for a whole PR

in addition some folks try to make "suggestions" (in the github-sense) to those annotations, which you can only do for changed lines and 3 lines around. they're confused that you can't click the suggest-button outside such a chunk:

dcos-docs-site 2020-08-25 11-37-08

now i'm under the impression that only annotating lines that actually changed on a PR might be highly beneficial in our use case. in case you think so too, i wondered whether you would consider having this kind of functionality within vale-action or whether you see a way to have this without altering vale-action.

In case you also feel a change in vale-action would be needed and you'd be willing to have the additional complexity in here, i'd love to contribute that with your guidance.

What do you think?

Encounter affix key error beyond `v1.3.0`

Related to this issue errata-ai/vale#328.

I recently upgraded the CI from v1.3.0 to v1.4.1 (and tested v.1.4.0 too) and encounter this error. This does not happen with v1.3.0.
image

This is recently got fixed in vale and does not occur for me locally vale version 2.10.3.

Vale GitHub action always reports two statuses on pull requests

I can't understand why the Vale GitHub action always reports two separate statuses on my pull request. One of these statuses always appears grouped inside another random GitHub Action. 🤔

In the example below:

  • The first status seems to be the "correct one" ✔️
  • The second status is for a push event (even though my workflow specifies that Vale should only run on pull_request events) and is incorrectly grouped under a different GitHub Action that has nothing to do with Vale

image

I have already checked my configuration multiple times at some point, but could never figure out why this happens. Can anyone help?

Action crashes when it runs: TypeError: Cannot read property 'chmod' of undefined

Due to a change either in the alpine package, or in the underlying Docker image, the action is currently failing when it runs, with the following error message:

/usr/bin/docker run --name af96b41506fefc84ed4768a0e87e956b331920_222ca3 --label af96b4 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_STYLES -e INPUT_CONFIG -e INPUT_FILES -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/cross_compile/cross_compile":"/github/workspace" af96b4:1506fefc84ed4768a0e87e956b331920  "https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip
https://github.com/errata-ai/Joblint/releases/latest/download/Joblint.zip
" "https://gist.githubusercontent.com/jdkato/171186055d382c6065273fe5a7eeeb61/raw/c6832996f5c77002142df70a3aa2be521fe747a7/.vale.ini" "all"
/node_modules/@actions/io/lib/io-util.js:16
_a = fs.promises, exports.chmod = _a.chmod, exports.copyFile = _a.copyFile, exports.lstat = _a.lstat, exports.mkdir = _a.mkdir, exports.readdir = _a.readdir, exports.readlink = _a.readlink, exports.rename = _a.rename, exports.rmdir = _a.rmdir, exports.stat = _a.stat, exports.symlink = _a.symlink, exports.unlink = _a.unlink;
                                     ^

TypeError: Cannot read property 'chmod' of undefined
    at Object.<anonymous> (/node_modules/@actions/io/lib/io-util.js:16:38)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/node_modules/@actions/io/lib/io.js:15:16)
    at Module._compile (module.js:635:30)

This repository CI can catch this issue. To repro, you can either force a rebuild using the UI. On my side, I forked this repository and pushed an empty commit to get the action to run in my fork:

https://github.com/thomas-moulard/vale-action

https://github.com/thomas-moulard/vale-action/commit/ea5d6c244f79e5a731f0431793e692c52baa9b9f/checks?check_suite_id=354149836

There is no difference between my fork and errata-ai/vale-action so it should also fail in this repo.

note: I would suggest to enable a nightly job to catch those types of regressions in the future

Docs for vale-action are misleading with filter_mode

By looking at the README.md

### `filter_mode` (default: added)

Set the [filter mode](https://github.com/reviewdog/reviewdog#filter-mode) for
`reviewdog`.

...
with:
  # added, diff_context, file, nofilter
  level: nofilter
...

It looks like the YAML code snippet is just copypasted from the above. The key should be filter_mode and the values, any of the possible options.

Feature Wish: configure .vale.ini location via "with"

Hi, thanks for providing an "offical" github action that puts checks on the specific lines!
I was short before building it myself and saved a lot of time.

It would allow for a more consistent and reliable configuration if I were able to override the default config file location from the repository root to another path in the repository.

I agree that convention over configuration is a good idea, so here's a better description of the use case to explain the need:

Background /Setup

Our Documentation is spread across different repositories and we maintain a central vale configuration (both .ini file and a set of custom rules) as a public NPM package which is then a dependency in every repository that generates documentation.

I can override the styles location merging a local .vale.ini with a styles path override to a remotely pulled .vale.ini but pulling one part (vale.ini) via HTTP from master and the other part (the style rules) via NPM in a specific version will lead to issues at some point (e.g. the ini referencing a rule that is not published yet).

In practice, i would do a dependency install before the vale action step, pass node_modules/@commercetools-docs/writing-style/.vale.ini as the config path and that's it.

Other use cases for custom config paths are e.g. monorepositories with many packages that have local .vale.ini files in subfolders.

Does this action support DITA files?

Got this error when including .dita files in the action:

Error: {
11
  "Code": "E100",
12
  "Text": "E100 [lintDITA] Runtime error\n\ndita not found\n\nExecution stopped with code 1."
13
}

_onlyModified is failing

I'm testing out the Vale action for onlyModified and I am getting the following failure.

Warning: User-specified path (__onlyModified) is invalid; falling back to 'all'.

You can review my code and test here https://github.com/tjperry07/vale-setup/pull/1/checks?check_run_id=1413681722

Run errata-ai/[email protected]
/usr/bin/docker run --name ad72896c53a74836b0358e95b19b1553_016fa3 --label 179394 --workdir /github/workspace --rm -e GITHUB_TOKEN -e INPUT_FILES -e INPUT_STYLES -e INPUT_CONFIG -e INPUT_DEBUG -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/vale-setup/vale-setup":"/github/workspace" 179394:ad72896c53a74836b0358e95b19b1553  "" "" "__onlyModified" "false"
Warning: User-specified path (__onlyModified) is invalid; falling back to 'all'.
Vale: Found 0 suggestion(s), 0 warning(s), and 4 error(s).

action file

name: Linting
on: [push]

jobs:
  prose:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@master

    - name: Vale
      uses: errata-ai/[email protected]
      with:
        # Optional
        # styles: |
        #   https://github.com/errata-ai/Microsoft/releases/latest/download/Microsoft.zip
        #   https://github.com/errata-ai/write-good/releases/latest/download/write-good.zip

        # # Optional
        # config: https://raw.githubusercontent.com/errata-ai/vale/master/.vale.ini

        # Optional
        files: __onlyModified
      env:
        # Required
        GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Can Action support spelling checks

I noticed that you disabled spelling checks in your example, and so far when I've tested, actions with spelling checks defined seem to fail silently, so as far as you know, are they not currently possible, and what would be needed to make them possible?

GitHub action fails if remotely-hosted `config` is used

If I define remotely-hosted config for the action, it fails with the following error, implying that the style rules are not found:

Error: {
  "Code": "E100",
  "Text": "E100 [NewE201] Runtime error\n\nopen Vaadin/Abbr.yml: no such file or directory\n\nExecution stopped with code 1."
}

This used to work, but started to fail consistently ~2 weeks ago.

Here’s an example PR, where it first works without the config (commit #1), but when it’s added, it starts failing (commit #2).

How to only run Vale on modified files?

Currently when using the Vale GitHub action the example configuration runs Vale across all files in the repository but do you have an example configuration where Vale is only run against the files that have been modified in the commit / PR?

Providing path to .vale.ini file

Is it possible to tell the vale-action the location of a .vale.ini file?
Instead of expecting it at the root directory of the repository...

I tried providing it as a vale_flag argument: "--config='my/path/to/.vale.ini'" but it didn't work. Failure occured in vale sync step since it was not considering its location.

I would be interested in this feature if possible. I don't know if it is already available.

Docs for GITHUB_TOKEN

Are there any docs for what GITHUB_TOKEN expects? I tried to use a token with repo access but that failed with:

You must authenticate via a GitHub App.

Any pointers would be helpful.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.