├── Dockerfile ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── action.yml └── assets └── screenshot.png /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ruby:2.6.3-alpine 2 | 3 | RUN apk add --update --no-cache git nodejs 4 | RUN gem install danger -v '>= 5.10.3' 5 | RUN gem install danger-textlint 6 | 7 | ENTRYPOINT "danger" 8 | CMD "--verbose" 9 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | 2 | gem "danger", "~> 6.0" 3 | 4 | gem "danger-textlint", "~> 1.2" 5 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | specs: 3 | addressable (2.5.2) 4 | public_suffix (>= 2.0.2, < 4.0) 5 | claide (1.0.2) 6 | claide-plugins (0.9.2) 7 | cork 8 | nap 9 | open4 (~> 1.3) 10 | colored2 (3.1.2) 11 | cork (0.3.0) 12 | colored2 (~> 3.1) 13 | danger (6.0.6) 14 | claide (~> 1.0) 15 | claide-plugins (>= 0.9.2) 16 | colored2 (~> 3.1) 17 | cork (~> 0.1) 18 | faraday (~> 0.9) 19 | faraday-http-cache (~> 1.0) 20 | git (~> 1.5) 21 | kramdown (~> 2.0) 22 | kramdown-parser-gfm (~> 1.0) 23 | no_proxy_fix 24 | octokit (~> 4.7) 25 | terminal-table (~> 1) 26 | danger-plugin-api (1.0.0) 27 | danger (> 2.0) 28 | danger-textlint (1.2.2) 29 | danger-plugin-api (~> 1.0) 30 | faraday (0.15.4) 31 | multipart-post (>= 1.2, < 3) 32 | faraday-http-cache (1.3.1) 33 | faraday (~> 0.8) 34 | git (1.5.0) 35 | kramdown (2.1.0) 36 | kramdown-parser-gfm (1.0.1) 37 | kramdown (~> 2.0) 38 | multipart-post (2.0.0) 39 | nap (1.1.0) 40 | no_proxy_fix (0.1.2) 41 | octokit (4.13.0) 42 | sawyer (~> 0.8.0, >= 0.5.3) 43 | open4 (1.3.4) 44 | public_suffix (3.0.3) 45 | sawyer (0.8.1) 46 | addressable (>= 2.3.5, < 2.6) 47 | faraday (~> 0.8, < 1.0) 48 | terminal-table (1.8.0) 49 | unicode-display_width (~> 1.1, >= 1.1.1) 50 | unicode-display_width (1.4.1) 51 | 52 | PLATFORMS 53 | ruby 54 | 55 | DEPENDENCIES 56 | danger (~> 6.0) 57 | danger-textlint (~> 1.2) 58 | 59 | BUNDLED WITH 60 | 2.0.1 61 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Yuichi Tanaka 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # danger-textlint-actions 2 | 3 | This GitHub Action submits textlint review comments if there are violations. 4 | 5 | 6 | 7 | ## Sample repository 8 | 9 | Here is the [sample repository](https://github.com/yuichielectric/danger-textlint-actions-demo) I've set up the automation. 10 | 11 | ## Set up 12 | 13 | To set up the textlint, you need to 14 | 15 | 1. set up textlint 16 | 2. set up workflow 17 | 18 | ### 1. Set up textlint 19 | 20 | To set up textlint, we need `package.json`, `Dangerfile` and `.textlintrc`. Here are the examples: 21 | 22 | #### package.json 23 | 24 | ```json 25 | { 26 | "name": "danger-textlint-actions-demo", 27 | "version": "1.0.0", 28 | "dependencies": { 29 | "textlint": "^11.2.3", 30 | "textlint-rule-preset-japanese": "^2.0.1" 31 | } 32 | } 33 | ``` 34 | 35 | #### Dangerfile 36 | 37 | ```ruby 38 | textlint.max_severity = "warn" 39 | textlint.lint 40 | ``` 41 | 42 | #### .textlintrc 43 | 44 | ```json 45 | { 46 | "filters": {}, 47 | "rules": { 48 | "preset-japanese": true 49 | } 50 | } 51 | ``` 52 | 53 | ### 2. Set up workflow 54 | 55 | An example workflow looks like this: 56 | 57 | ```YAML 58 | on: pull_request 59 | name: textlint 60 | jobs: 61 | textlint: 62 | name: textlint 63 | runs-on: ubuntu-latest 64 | steps: 65 | - uses: actions/checkout@master 66 | - uses: actions/setup-node@v1 67 | with: 68 | node-version: 10.* 69 | - run: npm install 70 | - name: danger 71 | uses: yuichielectric/danger-textlint-actions@master 72 | env: 73 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 74 | ``` 75 | 76 | ## License 77 | 78 | [MIT](LICENSE) 79 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: "danger-textlint-actions" 2 | description: "This GitHub Action submits textlint review comments if there are violations." 3 | branding: 4 | icon: "check-circle" 5 | color: "gray-dark" 6 | runs: 7 | using: "docker" 8 | image: "Dockerfile" 9 | -------------------------------------------------------------------------------- /assets/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yuichielectric/danger-textlint-actions/667b71613b01accdff1ba013ead108c40f383f41/assets/screenshot.png --------------------------------------------------------------------------------