Tools: Add Tools
label (#5449)
#23
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 | |
on: | |
push: | |
paths: | |
- 'gov2/**' | |
branches: | |
- main | |
pull_request: | |
paths: | |
- 'gov2/**' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
# Optional: Allow read access to pull request. Use with `only-new-issues` option. | |
# pull-requests: read | |
jobs: | |
golangci: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- uses: actions/checkout@v3 | |
- 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.47.3 | |
- name: run golangci-lint | |
# If you get a linting error of "File is not `goimports`-ed", the solution is to run "gofmt -w ./<folder>". | |
run: | | |
cd gov2 | |
./lint_all_go.sh |