From 9f86496c331a292fc409f2236db33d8ab5f5ad94 Mon Sep 17 00:00:00 2001 From: Rodrigo Campos Date: Mon, 28 Apr 2025 12:25:04 +0200 Subject: [PATCH] ci: Check for exclude/replace directives To not accidentally break `go install`, let's add CI to check it. If in the future we need those directives, we can remove the CI check. Signed-off-by: Rodrigo Campos --- .github/workflows/validate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 89ace1499..361e465a9 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -147,6 +147,9 @@ jobs: - name: no toolchain in go.mod # See https://github.com/opencontainers/runc/pull/4717, https://github.com/dependabot/dependabot-core/issues/11933. run: | if grep -q '^toolchain ' go.mod; then echo "Error: go.mod must not have toolchain directive, please fix"; exit 1; fi + - name: no exclude nor replace in go.mod + run: | + if grep -Eq '^\s*(exclude|replace) ' go.mod; then echo "Error: go.mod must not have exclude/replace directive, it breaks go install. Please fix"; exit 1; fi commit: