Skip to content

Commit

Permalink
Merge pull request #38 from reviewdog/default-token
Browse files Browse the repository at this point in the history
Provide default Github token
  • Loading branch information
haya14busa authored May 11, 2020
2 parents 936582c + ce304e3 commit 1b5b1d4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
uses: ./ # Build with Dockerfile
# uses: docker://reviewdog/action-golangci-lint:v1 # Pre-built image
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "./testdata"
tool_name: "golangci-lint-dockerfile"

Expand All @@ -40,7 +39,6 @@ jobs:
- name: golangci-lint w/ github-pr-review
uses: ./ # Build with Dockerfile
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "./testdata"
tool_name: "golangci-lint-github-pr-review"
reporter: "github-pr-review"
Expand All @@ -54,7 +52,6 @@ jobs:
- name: golangci-lint w/ github-check
uses: ./ # Build with Dockerfile
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "./testdata"
tool_name: "golangci-lint-github-check"
level: warning
Expand Down
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ code review experience.

### `github_token`

**Required**. Must be in form of `github_token: ${{ secrets.github_token }}`'.
**Required**. Default is `${{ github.token }}`. If using a pre-built docker image, you must set it explicitly to `github_token: ${{ secrets.github_token }}`.

### `golangci_lint_flags`

Expand Down Expand Up @@ -77,8 +77,6 @@ jobs:
uses: actions/checkout@v1
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
```
### Advanced Usage Example
Expand All @@ -101,7 +99,6 @@ jobs:
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
# Can pass --config flag to change golangci-lint behavior and target
# directory.
golangci_lint_flags: "--config=.github/.golangci.yml ./testdata"
Expand All @@ -116,7 +113,6 @@ jobs:
- name: golint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E golint"
tool_name: golint # Change reporter name.
level: warning # GitHub Status Check won't become failure with this level.
Expand All @@ -131,7 +127,6 @@ jobs:
- name: errcheck
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--disable-all -E errcheck"
tool_name: errcheck
level: info
Expand All @@ -154,6 +149,5 @@ jobs:
- name: golangci-lint
uses: reviewdog/action-golangci-lint@v1
with:
github_token: ${{ secrets.github_token }}
golangci_lint_flags: "--enable-all --exclude-use-default=false"
```
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ inputs:
github_token:
description: 'GITHUB_TOKEN.'
required: true
default: ${{ github.token }}
golangci_lint_flags:
description: 'golangci-lint flags. (golangci-lint run --out-format=line-number <golangci_lint_flags>)'
default: ''
Expand Down

0 comments on commit 1b5b1d4

Please sign in to comment.