Skip to content

Commit

Permalink
Merge pull request #292 from reviewdog/update-doc
Browse files Browse the repository at this point in the history
Update document about GitHub Actions platform
  • Loading branch information
haya14busa committed Sep 15, 2019
2 parents 2bf4e59 + 8ad5124 commit 0138713
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
28 changes: 20 additions & 8 deletions README.md
Expand Up @@ -257,19 +257,11 @@ Example: [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml)
```yaml
- name: Run reviewdog
env:
CI_PULL_REQUEST: ${{ github.event.number }}
CI_COMMIT: ${{ github.event.pull_request.head.sha }}
CI_REPO_OWNER: ${{ github.event.repository.owner.login }}
CI_REPO_NAME: ${{ github.event.repository.name }}
CI_BRANCH: ${{ github.event.pull_request.head.ref }}
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
golint ./... | reviewdog -f=golint -reporter=github-pr-check
```

You don't need to specify `CI_*` environment variables once
[#279](https://github.com/reviewdog/reviewdog/issues/279) is fixed.

Note that it reports result to GitHub Actions log consle for Pull
Requests from fork repository because due to [GitHub Actions
restriction](https://help.github.com/en/articles/virtual-environments-for-github-actions#github_token-secret),
Expand Down Expand Up @@ -369,6 +361,26 @@ $ reviewdog -reporter=gitlab-mr-commit

## Supported CI services

### GitHub Actions

Example: [.github/workflows/reviewdog.yml](.github/workflows/reviewdog.yml)

```yaml
name: reviewdog
on: [pull_request]
jobs:
reviewdog:
name: reviewdog
runs-on: ubuntu-latest
steps:
# ...
- name: Run reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
reviewdog -reporter=github-pr-check -runners=golint,govet
```

### Travis CI

#### Travis CI (-reporter=github-pr-check)
Expand Down
2 changes: 1 addition & 1 deletion cmd/reviewdog/main.go
Expand Up @@ -118,7 +118,7 @@ const (
$ export REVIEWDOG_INSECURE_SKIP_VERIFY=true
For non-local reporters, reviewdog automatically get necessary data from
environment variable in CI service (Travis CI, Circle CI, drone.io, GitLab CI).
environment variable in CI service (GitHub Actions, Travis CI, Circle CI, drone.io, GitLab CI).
You can set necessary data with following environment variable manually if
you want (e.g. run reviewdog in Jenkins).
Expand Down

0 comments on commit 0138713

Please sign in to comment.