fixup, go mod tidy -diff not yet implemented #3
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: Code static analysis | |
"on": | |
push: | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pull-requests: read | |
jobs: | |
golangci-notebook-controller: | |
name: golangci-lint (components/notebook-controller) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache-dependency-path: components/notebook-controller/go.sum | |
- name: golangci-lint (components/notebook-controller) | |
if: "${{ !cancelled() }}" | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.58 | |
working-directory: components/notebook-controller | |
# additional checks not part of golangci-lint | |
# https://github.com/golangci/golangci-lint/issues/4123 | |
- run: go mod verify | |
if: "${{ !cancelled() }}" | |
working-directory: components/notebook-controller | |
# https://github.com/golang/go/issues/27005 | |
- run: | | |
set -e | |
go mod tidy | |
if [[ $(git ls-files . -d -m -o --exclude-standard --full-name -v | tee modified.log | wc -l) -gt 0 ]]; then | |
echo "There are changed files:" | |
cat modified.log | |
git diff | |
exit 1 | |
fi | |
# https://go.googlesource.com/vuln | |
# https://github.com/golangci/golangci-lint/issues/3094 | |
- run: | | |
go install golang.org/x/vuln/cmd/govulncheck@latest | |
govulncheck ./... | |
if: "${{ !cancelled() }}" | |
working-directory: components/notebook-controller | |
golangci-odh-notebook-controller: | |
name: golangci-lint (components/odh-notebook-controller) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache-dependency-path: components/odh-notebook-controller/go.sum | |
- name: golangci-lint (components/odh-notebook-controller) | |
if: "${{ !cancelled() }}" | |
uses: golangci/golangci-lint-action@v6 | |
with: | |
version: v1.58 | |
working-directory: components/odh-notebook-controller | |
# additional checks not part of golangci-lint | |
# https://github.com/golangci/golangci-lint/issues/4123 | |
- run: go mod verify | |
if: "${{ !cancelled() }}" | |
working-directory: components/odh-notebook-controller | |
# https://github.com/golang/go/issues/27005 | |
- run: | | |
set -e | |
go mod tidy | |
if [[ $(git ls-files . -d -m -o --exclude-standard --full-name -v | tee modified.log | wc -l) -gt 0 ]]; then | |
echo "There are changed files:" | |
cat modified.log | |
git diff | |
exit 1 | |
fi | |
if: "${{ !cancelled() }}" | |
working-directory: components/odh-notebook-controller | |
# https://go.googlesource.com/vuln | |
# https://github.com/golangci/golangci-lint/issues/3094 | |
- run: | | |
go install golang.org/x/vuln/cmd/govulncheck@latest | |
govulncheck ./... | |
if: "${{ !cancelled() }}" | |
working-directory: components/odh-notebook-controller |