Skip to content

Commit

Permalink
run lint only on diff (#2526)
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Noetzlin <simon.ntz@gmail.com>
  • Loading branch information
2 people authored and lg committed Jun 30, 2023
1 parent 9ad9a81 commit 9efa732
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9efa732

Please sign in to comment.