Skip to content

Upgrade golanglint-ci version #8

Upgrade golanglint-ci version

Upgrade golanglint-ci version #8

Workflow file for this run

name: Go Lint CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.22.2'
- name: Install dependencies
run: |
go mod download
go mod tidy
- name: Install golangci-lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.58.1
golangci-lint --version
- name: Run golangci-lint on PR
if: github.event_name == 'pull_request'
run: |
golangci-lint run --new-from-rev ${{ github.event.pull_request.base.sha }} --config .golangci.yaml
continue-on-error: true
- name: Run golangci-lint on main branch push
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
golangci-lint run --config .golangci.yaml
continue-on-error: true
# - name: Display golangci-lint results
# if: failure()
# run: cat golangci-lint.log