Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: run lint only on diff #2526

Merged
merged 2 commits into from
May 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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