Detect CJK (Chinese, Japanese, and Korean) text in your repository.
- GitHub Action: fail the workflow when CJK text is detected
- CLI: scan files and exit with code 1 when CJK text is detected
- Library: functions to find CJK lines in strings
This action runs the nocjk CLI built from the same Git reference as the action itself, ensuring the action version and the CLI version always match.
jobs:
check-cjk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Detect CJK text
uses: aethiopicuschan/nocjk@v1
with:
args: "."| Name | Description | Default |
|---|---|---|
| args | Paths or arguments passed to nocjk |
. |
| ignore_chinese | Ignore Chinese text | false |
| ignore_japanese | Ignore Japanese text | false |
| ignore_korean | Ignore Korean text | false |
- 0: No CJK text found (workflow succeeds)
- 1: CJK text detected (workflow fails)
You can define ignore rules using a .nocjkignore file in your project root. The format is fully compatible with .gitignore. Files and directories matching the patterns in this file will be skipped during CJK text detection.
go install github.com/aethiopicuschan/nocjk/cmd/nocjk@v1nocjk .When CJK text is detected, the CLI exits with error code 1.
--ignore-chineseto ignore Chinese text--ignore-japaneseto ignore Japanese text--ignore-koreanto ignore Korean text
.nocjkignore is supported for skipping specific files and directories.
go get -u github.com/aethiopicuschan/nocjk/pkg/nocjkSee GoDoc for usage instructions.