From 4b3fb4094e6cc3b0a9145bde40e71faa3b5f43b1 Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Fri, 11 Oct 2024 23:50:41 -0400 Subject: [PATCH] chore(gh): update `golangci-lint` workflow - Updates the GitHub Action for `golangci-lint`. - Pin GitHub Actions to release commit SHA. Signed-off-by: Ryan Johnson --- .github/workflows/golangci-lint.yml | 33 ++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 8f01f825e..617f8cba0 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,19 +1,32 @@ name: golangci-lint + on: pull_request: + paths-ignore: + - 'README.md' + push: + paths-ignore: + - 'README.md' + +permissions: + contents: read + jobs: - test: + build: + name: Build runs-on: ubuntu-latest + timeout-minutes: 5 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - name: Checkout + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 + - name: Setup Go + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 with: go-version-file: 'go.mod' - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + cache: true + - run: go mod download + - run: go build -v . + - name: Run Linters + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6.1.1 with: - version: v1.56.1 - args: --issues-exit-code=1 - only-new-issues: true - skip-pkg-cache: true - skip-build-cache: true + version: latest