Skip to content

Commit 8d90e3d

Browse files
authored
Merge pull request #4750 from rata/go-mod-exclude-linter
ci: Check for exclude/replace directives
2 parents 8ba0a16 + 9f86496 commit 8d90e3d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

.github/workflows/validate.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ jobs:
147147
- name: no toolchain in go.mod # See https://github.com/opencontainers/runc/pull/4717, https://github.com/dependabot/dependabot-core/issues/11933.
148148
run: |
149149
if grep -q '^toolchain ' go.mod; then echo "Error: go.mod must not have toolchain directive, please fix"; exit 1; fi
150+
- name: no exclude nor replace in go.mod
151+
run: |
152+
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
150153
151154
152155
commit:

0 commit comments

Comments
 (0)