From 9e57defc8d89e5c0379f8dc708b5f9ce4c597258 Mon Sep 17 00:00:00 2001 From: mpoke Date: Tue, 23 May 2023 11:59:07 +0200 Subject: [PATCH] run lint only on diff --- .github/workflows/lint.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a0bcb75c53..97543a0ddca 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,26 +1,33 @@ -name: golangci-lint +name: Lint on: push: - tags: - - v* branches: - main + - release/** + - feat/** pull_request: permissions: contents: read - # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read jobs: golangci: - name: lint + name: golangci-lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3.5.2 - uses: actions/setup-go@v4 with: - go-version: 1.20.x - - uses: actions/checkout@v3.5.2 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + go-version: "1.20" + check-latest: true + - uses: technote-space/get-diff-action@v6.1.2 + id: git_diff with: - # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.52.2 + PATTERNS: | + **/*.go + go.mod + go.sum + **/go.mod + **/go.sum + - name: run linting + if: env.GIT_DIFF + run: | + make lint \ No newline at end of file