From f21730e8795a9b1c50a3dd378d1e66934ee1f443 Mon Sep 17 00:00:00 2001 From: wdvxdr Date: Sat, 10 Jul 2021 23:47:17 +0800 Subject: [PATCH] chore(ci): clean workflows. --- .github/workflows/golint.yml | 18 +++++++--------- .github/workflows/suggester.yml | 37 --------------------------------- 2 files changed, 8 insertions(+), 47 deletions(-) delete mode 100644 .github/workflows/suggester.yml diff --git a/.github/workflows/golint.yml b/.github/workflows/golint.yml index 4e03fff..f8e5dad 100644 --- a/.github/workflows/golint.yml +++ b/.github/workflows/golint.yml @@ -1,6 +1,6 @@ name: Lint -on: [push,workflow_dispatch] +on: [push,pull_request,workflow_dispatch] jobs: golangci: @@ -18,21 +18,13 @@ jobs: uses: golangci/golangci-lint-action@v2 with: version: latest - - - name: Cache downloaded module - uses: actions/cache@v2 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }} - name: Tests run: | go test $(go list ./...) - name: Commit back - if: github.repository_owner == 'Mrs4s' + if: ${{ github.repository_owner == 'Mrs4s' && github.event.push }} continue-on-error: true run: | git config --local user.name 'github-actions[bot]' @@ -40,3 +32,9 @@ jobs: git add --all git commit -m "ci(chore): Fix stylings" git push + + - name: Suggester + if: ${{ github.event.pull_request }} + uses: reviewdog/action-suggester@v1 + with: + tool_name: golangci-lint diff --git a/.github/workflows/suggester.yml b/.github/workflows/suggester.yml deleted file mode 100644 index a61f13b..0000000 --- a/.github/workflows/suggester.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Lint - -on: [pull_request] - -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Setup Go environment - uses: actions/setup-go@v2.1.3 - with: - go-version: 1.16 - - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: latest - - - name: Cache downloaded module - uses: actions/cache@v2 - with: - path: | - ~/.cache/go-build - ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ matrix.goos }}-${{ matrix.goarch }}-${{ hashFiles('**/go.sum') }} - - - name: Tests - run: | - go test $(go list ./...) - - - name: Suggester - uses: reviewdog/action-suggester@v1 - with: - tool_name: golangci-lint