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

Use golangci-lint action in github #2397

Merged
merged 1 commit into from
Feb 28, 2022
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
20 changes: 9 additions & 11 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ jobs:

lint:
runs-on: ubuntu-latest
env:
GO111MODULE: 'on'
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -54,16 +52,16 @@ jobs:
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: Install golangci-lint
working-directory: /tmp
run: |
GOLANGCI_LINT_VERSION=$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')
go install "github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_LINT_VERSION"
- name: Run linters
- name: Retrieve golangci-lint version
run: |
BASEREV=$(git merge-base HEAD origin/master)
echo "Base revision: $BASEREV"
golangci-lint run --out-format=tab --new-from-rev "$BASEREV" ./...
echo "::set-output name=Version::$(head -n 1 "${GITHUB_WORKSPACE}/.golangci.yml" | tr -d '# ')"
id: version
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: ${{ steps.version.outputs.Version }}
only-new-issues: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, glad to see this works now. The reason we didn't use it before was that only-new-issues didn't work the same as --new-from-rev so it always showed old issues.


test-prev:
strategy:
Expand Down