diff --git a/.travis.yml b/.travis.yml index cf30c3f..40ae759 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,4 @@ install: script: - npm test after_failure: - - test $TRAVIS_PULL_REQUEST == "false" && $(npm bin)/textlint -f checkstyle README.md | reviewdog -f=checkstyle -name="textlint" -ci="travis" \ No newline at end of file + - test $TRAVIS_PULL_REQUEST == "true" && $(npm bin)/textlint -f checkstyle README.md | reviewdog -f=checkstyle -name="textlint" -ci="travis" \ No newline at end of file diff --git a/README.md b/README.md index f1935d7..331a8df 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,56 @@ See also: - [reviewdog — A code review dog who keeps your codebase healthy – Medium](https://medium.com/@haya14busa/reviewdog-a-code-review-dog-who-keeps-your-codebase-healthy-d957c471938b) -## Usage +## How to setup? - [ ] Write usage instructions +### 1. Setup .travis.yml + +```yaml +sudo: false +language: node_js +node_js: "stable" +env: +- REVIEWDOG_VERSION=0.9.5 +install: + - mkdir -p ~/bin/ && export export PATH="~/bin/:$PATH" + - curl -fSL https://github.com/haya14busa/reviewdog/releases/download/$REVIEWDOG_VERSION/reviewdog_linux_amd64 -o ~/bin/reviewdog && chmod +x ~/bin/reviewdog + - npm install +script: + - npm test +after_failure: + - test $TRAVIS_PULL_REQUEST == "false" && $(npm bin)/textlint -f checkstyle README.md | reviewdog -f=checkstyle -name="textlint" -ci="travis" +``` + +See [.travis.yml](.travis.yml) for details. + +### 2. Add `REVIEWDOG_GITHUB_API_TOKEN` to Travis CI Config + +Get your [personal access token](https://github.com/settings/tokens/new "New personal access token"). + +![repo](https://monosnap.com/file/duLWpPrFoqR8uPvOZOniupuiptE1GB.png) + +Set the access token to `REVIEWDOG_GITHUB_API_TOKEN`. + +``` +travis env set REVIEWDOG_GITHUB_API_TOKEN +``` + +You can check the result: + +``` +$ travis env list +# environment variables for azu/textlint-reviewdog-example +REVIEWDOG_GITHUB_API_TOKEN=[secure] +``` + +### 3. Submit PR + +See Example Pull Request. + +- [docs: Update README by azu · Pull Request #1 · azu/textlint-reviewdog-example](https://github.com/azu/textlint-reviewdog-example/pull/1 "docs: Update README by azu · Pull Request #1 · azu/textlint-reviewdog-example") + ## Running tests Install devDependencies and Run `npm test`: