fix(ci): fix linter issues and use deterministic golangci-lint version used both locally and in CI #1630
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: golangci-lint | |
concurrency: | |
# Run only for most recent commit in PRs but for all tags and commits on main | |
# Ref: https://docs.github.com/en/actions/using-jobs/using-concurrency | |
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'release/*' | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
golangci: | |
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT) }} | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- run: | | |
echo "YQ_VERSION=$(yq -r '.golangci-lint' < .tools_versions.yaml)" >> $GITHUB_ENV | |
- uses: golangci/golangci-lint-action@v6 | |
with: | |
# actions/setup-go@v5 introduced automatic cache handling so skip cache here | |
skip-cache: true | |
version: "v${{ env.YQ_VERSION }}" | |
- name: Verify Codegen | |
run: make verify-codegen |