From 97c091ff25acb5d2ea784f93b2f20e8b922c5353 Mon Sep 17 00:00:00 2001 From: "Yuan (Bob) Gong" <4957653+Bobgy@users.noreply.github.com> Date: Sun, 10 Apr 2022 11:46:47 +0800 Subject: [PATCH] chore: pin go to 1.17 to fix golangci-lint failing in 1.18 (#121) --- .github/workflows/go.yml | 7 ++++++- .github/workflows/golangci-lint.yml | 14 +++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 47644a2..3d2ca9b 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,6 +1,11 @@ name: Go on: push: + tags: + - v* + branches: + - master + - main pull_request: jobs: build: @@ -10,7 +15,7 @@ jobs: - name: Set up Go 1.x uses: actions/setup-go@v2 with: - go-version: ^1.13 + go-version: 1.17 - name: Check out code into the Go module directory uses: actions/checkout@v2 - name: Get dependencies diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 9d9bcaf..24e0320 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,15 +1,27 @@ name: golangci-lint on: push: + tags: + - v* + branches: + - master + - main pull_request: +permissions: + contents: read jobs: golangci: name: lint runs-on: ubuntu-latest steps: + - uses: actions/setup-go@v2 + with: + # golangci-lint breaks on 1.18 for now: https://github.com/golangci/golangci-lint/issues/2649 + # TODO(Bobgy): revert to ^1.17 for this and go.yml after it's fixed. + go-version: 1.17 - uses: actions/checkout@v2 - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + uses: golangci/golangci-lint-action@v3 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. # NOTICE: golangci-lint version should be the same as go.mod. When upgrading, also update go.mod by: