GitHub Action
vale-lint
0.1.0
Latest version
Use the official Vale action available at https://github.com/errata-ai/vale-action
Automatically lint all modified text files in your GitHub pull requests. This GitHub action uses Vale to lint prose.
The github-action-vale-lint
checks all modified text (including markup) files and reports failure on error.
You must have Vale configuration file .vale.ini
in your repository.
-
Create a new file in your repository
.github/workflows/action.yml
.touch .github/workflows/pull_request.yml
-
Copy-paste the folloing workflow in your
pull_request.yml
file:name: Lint PRs with Vale on: pull_request jobs: vale-lint-PR: runs-on: ubuntu-latest steps: - uses: actions/checkout@master with: fetch-depth: 1 - uses: gaurav-nelson/github-action-vale-lint@v0.1.0 env: GH_COMMENT_TOKEN: ${{ secrets.GH_COMMENT_TOKEN }}
-
Or, if you want to lint all files (or files in a specific folder) and not just modified files, use the following workflow in your
pull_request.yml
file:name: Lint PRs with Vale on: pull_request jobs: vale-lint-PR: runs-on: ubuntu-latest steps: - uses: actions/checkout@master with: fetch-depth: 1 - uses: gaurav-nelson/github-action-vale-lint@v0.1.0 with: lint-all-files: 'yes' dir-to-lint: 'directory/path/to/lint' env: GH_COMMENT_TOKEN: ${{ secrets.GH_COMMENT_TOKEN }}
If you want to show errors as comments on the pull request, in your repository:
- Go to Settings > Secrets, and slect Add a new secret.
- Enter GH_COMMENT_TOKEN for Name, and enter your secret token as Value.
- Select Add secret.