All Projects → errata-ai → vale-action

errata-ai / vale-action

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

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to vale-action

php-skeleton
A skeleton to start new high-quality PHP projects without worrying about bootstrapping everything from scratch.
Stars: ✭ 23 (-69.74%)
Mutual labels:  github-actions
all-about-reactJS
I'll be working on 20 different ReactJS projects over the course of 60 days and try to create mobile-first, light and dark themed apps out of them.
Stars: ✭ 15 (-80.26%)
Mutual labels:  github-actions
chalice-extended-action
Automated deployment of your Chalice application via Github Actions
Stars: ✭ 18 (-76.32%)
Mutual labels:  github-actions
ci-notice
😱 Notify you when CI fails.
Stars: ✭ 25 (-67.11%)
Mutual labels:  github-actions
action-hadolint
Run hadolint with reviewdog 🐶
Stars: ✭ 38 (-50%)
Mutual labels:  github-actions
actions
A collection of GitHub Actions
Stars: ✭ 21 (-72.37%)
Mutual labels:  github-actions
sentry-release
GitHub Action for publishing a new release to Sentry.io
Stars: ✭ 13 (-82.89%)
Mutual labels:  github-actions
python-lint
GitHub Action for Lint your code
Stars: ✭ 57 (-25%)
Mutual labels:  github-actions
scorecard-action
Official GitHub Action for OSSF Scorecards.
Stars: ✭ 33 (-56.58%)
Mutual labels:  github-actions
setup-gleam
👷‍♀️ Gleam on GitHub Actions
Stars: ✭ 16 (-78.95%)
Mutual labels:  github-actions
intellij-platform-plugin-verifier-action
GitHub Action for executing the intellij-plugin-verifier
Stars: ✭ 20 (-73.68%)
Mutual labels:  github-actions
setup-graphviz
▶️ GitHub Action to set up Graphviz cross-platform(Linux, macOS, Windows).
Stars: ✭ 20 (-73.68%)
Mutual labels:  github-actions
build-godot-action
GitHub action that builds a Godot project for multiple platforms
Stars: ✭ 62 (-18.42%)
Mutual labels:  github-actions
awesome-address-book
This project shows a basic address book built with ReactJS, Redux Toolkit and Typescript 📖
Stars: ✭ 20 (-73.68%)
Mutual labels:  github-actions
setup-task
GitHub Actions action to make Task available for use in your workflow
Stars: ✭ 14 (-81.58%)
Mutual labels:  github-actions
bridgecrew-action
This Github Action runs Bridgecrew against an Infrastructure-as-Code repository. Bridgecrew performs static security analysis of Terraform & CloudFormation Infrastructure code.
Stars: ✭ 52 (-31.58%)
Mutual labels:  github-actions
github-act-runner
act as self-hosted runner
Stars: ✭ 68 (-10.53%)
Mutual labels:  github-actions
Android-CICD
This repo demonstrates how to work on CI/CD for Mobile Apps 📱 using Github Actions 💊 + Firebase Distribution 🎉
Stars: ✭ 37 (-51.32%)
Mutual labels:  github-actions
actions-readme-feed
Display RSS feed in your GitHub Profile README
Stars: ✭ 26 (-65.79%)
Mutual labels:  github-actions
cake-build
Demonstrates a basic build of a .NET NuGet package using https://cakebuild.net/
Stars: ✭ 22 (-71.05%)
Mutual labels:  github-actions

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, but you need the actions/checkout@master step) to one of your .github/workflows files:

name: Linting
on: [push]

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

    - name: Vale
      uses: errata-ai/vale-action@v1
      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: path/to/lint
      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}}

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.

styles

styles is a space-delimited list of external styles to install into your repository's local StylesPath. Each link needs to point to a single .zip file containing the style:

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

See errata-ai/styles for more information.

config

config is a single, remotely-hosted Vale configuration file:

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

This configuration file can be hosted in another repo (as shown above), a GitHub Gist, or another source altogether. If you also have a .vale.ini file in the local repo, the two files will be combined according to the following rules:

  1. Any multi-value entry in the local .vale.ini file (e.g., BasedOnStyles) will be combined with the remote entry.
  2. Any single-value entry in the local .vale.ini file (e.g., MinAlertLevel) will override the remote entry altogether.

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 three ways:

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

  • files: __onlyModified: Lint only files that have been modified within a PR.

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

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

onlyAnnotateModifiedLines (default: false)

In case you want the action to only annotate lines that have been modified within a PR. This is helpful in case you're introducing vale to a repository that (still) has a lot of lints and don't want to overwhelm everyone.

with:
  onlyAnnotateModifiedLines: true

Limitations

Due to the current token permissions, this Action CAN NOT post annotations to PRs from forked repositories.

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

A workaround is to run this action as a follow-up workflow. For example, pull_request workflow generates source artifact and post-workflow scan artifact with vale and then annotate the commit. Use OVERRIDE_GITHUB_SHA environment variable to override the commit SHA to annotate if matching a Pull Request.

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

jobs:
  vale:
    runs-on: ubuntu-20.04
    steps:
      ...
      - name: Grab pull request sha1
        run: |
          ....
          echo "PR_SHA=$pr_sha" >> $GITHUB_ENV
      - name: Vale Linter
        uses: errata-ai/[email protected]
        with:
          ...
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          OVERRIDE_GITHUB_SHA: ${{env.PR_SHA}}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].