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