Merge pull request #2412 from reviewdog/renovate/gitlab.com-gitlab-or… #74
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: reviewdog | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| reviewdog-github-check: | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| name: reviewdog (github-check) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Install linters | |
| run: go install golang.org/x/lint/golint@latest | |
| - name: Setup reviewdog | |
| # uses: reviewdog/action-setup@v1 | |
| run: | | |
| go install ./cmd/reviewdog | |
| - name: Run reviewdog | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| golint ./... | reviewdog -f=golint -name=golint-github-check -reporter=github-check -level=warning | |
| - name: Run reviewdog with sub-dir (github-check) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd ./_testdata/ && golint ./... | reviewdog -f=golint -name=golint-check-subdir -reporter=github-check -level=info -filter-mode=nofilter | |
| - name: Custom rdjson test (github-check) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cat ./_testdata/custom_rdjson.json | \ | |
| reviewdog -name="custom-rdjson" -f=rdjson -reporter=github-check -level=info | |
| - name: reviewdog project run | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| reviewdog -reporter=github-check | |
| reviewdog-pr: | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| if: github.event_name == 'pull_request' | |
| name: reviewdog on Pull Request | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Install linters | |
| run: go install golang.org/x/lint/golint@latest | |
| - name: Setup reviewdog | |
| # uses: reviewdog/action-setup@v1 | |
| run: | | |
| go install ./cmd/reviewdog | |
| - name: Run reviewdog (github-pr-check) | |
| continue-on-error: true | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| reviewdog -reporter=github-pr-check -runners=golint,govet -fail-on-error | |
| - name: Run reviewdog (github-pr-review with tee) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Remove Go Problem Matchers [1] as it reports duplicate results with | |
| # reviewdog. | |
| # [1]: https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers | |
| echo "::remove-matcher owner=go::" | |
| golint ./... | reviewdog -f=golint -name=golint-pr-review -reporter=github-pr-review -tee | |
| - name: Run reviewdog with sub-dir (github-pr-review) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd ./_testdata/ && golint ./... | reviewdog -f=golint -name=golint-pr-review-subdir -reporter=github-pr-review | |
| - name: Run reviewdog with sub-dir (local+fail-on-error) | |
| run: | | |
| echo 'var LocalTest = 14' >> ./_testdata/golint.go | |
| cd ./_testdata/ && golint ./... | reviewdog -f=golint -diff="git diff" -fail-on-error || EXIT_CODE=$? | |
| git reset --hard @ | |
| test "${EXIT_CODE}" = 1 | |
| - name: Run reviewdog (github-pr-check with fail-on-error) | |
| continue-on-error: true | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd ./_testdata/ && golint ./... | reviewdog -f=golint -name=golint-pr-check-fail-on-error -reporter=github-pr-check -fail-on-error | |
| - name: Run reviewdog (github-pr-check with -filter-mode=file) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| golint | reviewdog -f=golint -name=golint-pr-check-filter-mode-file -reporter=github-pr-check -filter-mode=file -level=warning | |
| - name: Run reviewdog (github-pr-review -filter-mode=nofilter) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd ./_testdata/ && golint ./... | reviewdog -f=golint -name=golint-pr-review-nofilter -reporter=github-pr-review -filter-mode=nofilter -fail-on-error || EXIT_CODE=$? | |
| test "${EXIT_CODE}" = 1 | |
| - name: Unexpected failure (github-pr-review) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd ./_testdata/ && reviewdog -conf=reviewdog_error.yml \ | |
| -reporter=github-pr-review || EXIT_CODE=$? | |
| test "${EXIT_CODE}" = 1 | |
| - name: Unexpected failure (github-check) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cd ./_testdata/ && reviewdog -conf=reviewdog_error.yml \ | |
| -reporter=github-check || EXIT_CODE=$? | |
| test "${EXIT_CODE}" = 1 | |
| - name: Unexpected failure (local) | |
| run: | | |
| cd ./_testdata/ && reviewdog -conf=reviewdog_error.yml \ | |
| -reporter=local -diff='git diff master' || EXIT_CODE=$? | |
| test "${EXIT_CODE}" = 1 | |
| - name: Suggestion (rdjsonl) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cat ./_testdata/suggestions.json | \ | |
| reviewdog -name="suggestion-test" -f=rdjsonl -reporter=github-pr-review | |
| - name: Custom rdjsonl test (github-pr-review) | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cat ./_testdata/custom_rdjson.json | \ | |
| reviewdog -name="custom-rdjson" -f=rdjson -reporter=github-pr-review -filter-mode=file | |
| - name: gofmt -s with reviewdog | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gofmt -s -d . | \ | |
| reviewdog -name="gofmt" -f=diff -f.diff.strip=0 -reporter=github-pr-review | |
| - name: reviewdog project run | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| reviewdog -reporter=github-pr-review | |
| golangci-lint: | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| if: github.event_name == 'pull_request' | |
| name: runner / golangci-lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-golangci-lint@f9bba13753278f6a73b27a56a3ffb1bfda90ed71 # v2.8.0 | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| golangci_lint_flags: "--timeout 2m" | |
| level: "warning" | |
| reporter: github-pr-check | |
| staticcheck: | |
| permissions: | |
| checks: write | |
| contents: read | |
| pull-requests: write | |
| if: github.event_name == 'pull_request' | |
| name: runner / staticcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 | |
| with: | |
| go-version-file: "go.mod" | |
| - uses: reviewdog/action-staticcheck@50f9bfcf3738839ddc95deac241b904d77469096 # v1.28.0 | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| reporter: github-pr-review | |
| filter_mode: nofilter | |
| fail_level: any | |
| use_go_install: true | |
| # workdir: ./_testdata/ | |
| misspell: | |
| name: runner / misspell | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-misspell@d6429416b12b09b4e2768307d53bef58d172e962 # v1.27.0 | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| locale: "US" | |
| reporter: github-check | |
| reviewdog-github-annotations: | |
| permissions: | |
| contents: read | |
| name: reviewdog (github-pr-annotations) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Setup reviewdog | |
| # uses: reviewdog/action-setup@v1 | |
| run: | | |
| go install ./cmd/reviewdog | |
| - name: Custom rdjsonl test | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| jq -c -r '.diagnostics[:3].[]' ./_testdata/custom_rdjson.json | \ | |
| reviewdog -name="custom-rdjsonl" -f=rdjsonl -reporter=github-pr-annotations | |
| reviewdog-sarif: | |
| permissions: | |
| contents: read | |
| actions: read | |
| security-events: write | |
| name: reviewdog (sarif) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 | |
| with: | |
| go-version-file: "go.mod" | |
| - name: Setup reviewdog | |
| # uses: reviewdog/action-setup@v1 | |
| run: | | |
| go install ./cmd/reviewdog | |
| - name: Custom rdjson test | |
| run: | | |
| mkdir ../results | |
| cat ./_testdata/custom_rdjson.json | | |
| reviewdog -name="custom-rdjson" -f=rdjson -reporter=sarif | | |
| tee ../results/custom-rdjson.sarif | |
| - name: Install linters | |
| run: go install golang.org/x/lint/golint@latest | |
| - name: Run golint | |
| run: | | |
| golint ./... | reviewdog -f=golint -reporter=sarif | | |
| tee ../results/golint.sarif | |
| - uses: github/codeql-action/upload-sarif@2588666de8825e1e9dc4e2329a4c985457d55b32 # v3.32.1 | |
| typos: | |
| name: runner / typos | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-typos@d5eb1bbcd1b3bfde596f6eeb470322727862fe98 # v1.19.0 | |
| languagetool: | |
| name: runner / languagetool | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-languagetool@afd06e9b0f782c9562c92efffb66a49c09b2b4f4 # v1.23.0 | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| reporter: github-check | |
| level: info | |
| patterns: | | |
| **/*.md | |
| !**/testdata/** | |
| shellcheck: | |
| if: github.event_name == 'pull_request' | |
| name: runner / shellcheck | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-shellcheck@4c07458293ac342d477251099501a718ae5ef86e # v1.32.0 | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| reporter: github-pr-review | |
| alex: | |
| name: runner / alex | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-alex@6083b8ca333981fa617c6828c5d8fb21b13d916b # v1.16.0 | |
| with: | |
| github_token: ${{ secrets.github_token }} | |
| reporter: github-check | |
| level: info | |
| textlint: | |
| name: runner / textlint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 | |
| - run: npm install | |
| - name: textlint | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| npx textlint -f checkstyle README.md | \ | |
| reviewdog -f=checkstyle -name="textlint" -reporter=github-check -level=info | |
| sarif: | |
| name: runner / textlint sarif | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| - uses: reviewdog/action-setup@d8a7baabd7f3e8544ee4dbde3ee41d0011c3a93f # v1.5.0 | |
| - run: npm install | |
| - name: textlint sarif | |
| env: | |
| REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| npx textlint -f @microsoft/eslint-formatter-sarif README.md | \ | |
| reviewdog -f=sarif -name="textlint" -reporter=github-check -level=info |