From 8f622fc88d10e57261bf11844e55d3925e039cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Michon?= Date: Wed, 3 Aug 2022 16:09:24 +0200 Subject: [PATCH] feat(workflows/publish): golangci-lint --- .github/workflows/publish.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 10ff90dce..7ce042a8d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,7 +2,25 @@ name: Test and Release Go CLI on: [push] +permissions: + contents: read + # allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + jobs: + linter: + name: golangci-lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version-file: "go.mod" + check-latest: true + - uses: golangci/golangci-lint-action@v3 + with: + only-new-issues: false + tests: name: Unit Tests runs-on: ubuntu-latest @@ -16,7 +34,7 @@ jobs: run: go test -race ./... releases: - needs: tests + needs: [linter, tests] name: GoReleaser Build on All OS but Windows if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest