Skip to content

Commit

Permalink
CI: add textlint
Browse files Browse the repository at this point in the history
Instead of requesting changes in every pull requests and block them from merging,
we are trying to automate the process of adding missing spaces between half and
full-width characters using GitHub Actions.

The main idea is:

- Only run the workflow in the main repository (instead of other forks).
- Try to fix all files using textlint.
- Only commit files with .md extension.
- Directly push the change to the master branch.

Related projects:

- https://github.com/textlint/textlint
- https://github.com/textlint-ja/textlint-rule-preset-ja-spacing
- https://github.com/sparanoid/chinese-copywriting-guidelines

Related discussions:

- Anduin2017#88
  • Loading branch information
bobby285271 committed Feb 19, 2022
1 parent 256755b commit f0ba452
Show file tree
Hide file tree
Showing 4 changed files with 3,795 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/textlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Textlint

on:
schedule:
- cron: '0 */6 * * *'
workflow_dispatch:

jobs:
lint-fix:
runs-on: ubuntu-latest
if: github.repository_owner == 'Anduin2017'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
cache: 'npm'
- run: npm install
- run: ./node_modules/.bin/textlint . --fix
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: '[ci skip] Automatic textlint fixes'
branch: 'master'
file_pattern: ':/*.md'
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Dependency directories
node_modules/
Loading

0 comments on commit f0ba452

Please sign in to comment.