ci: fail if any Go files contain an ignore directive (#4055)

This commit is contained in:
Marten Seemann 2023-09-15 18:35:53 +07:00 committed by GitHub
parent c1ce4a8e92
commit 5b25d8b5be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,13 @@ jobs:
go-version: "1.20.x"
- name: Check that no non-test files import Ginkgo or Gomega
run: .github/workflows/no_ginkgo.sh
- name: Check for //go:build ignore in .go files
run: |
IGNORED_FILES=$(grep -rl '//go:build ignore' . --include='*.go') || true
if [ -n "$IGNORED_FILES" ]; then
echo "::error::Found ignored Go files: $IGNORED_FILES"
exit 1
fi
- name: Check that go.mod is tidied
run: |
cp go.mod go.mod.orig