Code Monkey home page Code Monkey 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.

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.

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

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

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.