Skip to content
check-circle

GitHub Action

danger-textlint-actions

1.1.0 Latest version

danger-textlint-actions

check-circle

danger-textlint-actions

This GitHub Action submits textlint review comments if there are violations

Installation

Copy and paste the following snippet into your .yml file.

              

- name: danger-textlint-actions

uses: yuichielectric/danger-textlint-actions@1.1.0

Learn more about this action in yuichielectric/danger-textlint-actions

Choose a version

danger-textlint-actions

This GitHub Action submits textlint review comments if there are violations.

Sample repository

Here is the sample repository I've set up the automation.

Set up

To set up the textlint, you need to

  1. set up textlint
  2. set up workflow

1. Set up textlint

To set up textlint, we need package.json, Dangerfile and .textlintrc. Here are the examples:

package.json

{
  "name": "danger-textlint-actions-demo",
  "version": "1.0.0",
  "dependencies": {
    "textlint": "^11.2.3",
    "textlint-rule-preset-japanese": "^2.0.1"
  }
}

Dangerfile

textlint.max_severity = "warn"
textlint.lint

.textlintrc

{
  "filters": {},
  "rules": {
    "preset-japanese": true
  }
}

2. Set up workflow

An example workflow looks like this:

on: pull_request
name: textlint
jobs:
  textlint:
    name: textlint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: actions/setup-node@v1
        with:
          node-version: 10.*
      - run: npm install
      - name: danger
        uses: yuichielectric/danger-textlint-actions@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

License

MIT