File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 7
7
pull_request :
8
8
9
9
env :
10
- # comma separated list of restricted Go modules
10
+ # comma separated list of restricted Go modules/packages
11
11
RESTRICTED_MODULES : " cosmossdk.io/x/circuit"
12
+ RESTRICTED_PACKAGES : " github.com/cosmos/cosmos-sdk/x/gov, github.com/cosmos/cosmos-sdk/x/group"
12
13
13
14
jobs :
14
15
go-mod-check :
33
34
exit 1
34
35
fi
35
36
done
37
+
38
+ for PACKAGE in "${RESTRICTED_PACKAGES[@]}"; do
39
+ OUTPUT=$(go mod why -vendor "$PACKAGE")
40
+ if echo "$OUTPUT" | grep -q "main module does not need to vendor package $PACKAGE"; then
41
+ echo "$PACKAGE is not imported ✓"
42
+
43
+ # if the shortest import path is the E2E suite, is is safe to assume the package is not used in the main module
44
+ elif echo "$OUTPUT" | grep -q "github.com/noble-assets/noble/e2e"; then
45
+ echo "$PACKAGE is not imported into main Noble module ✓"
46
+ else
47
+ echo "$PACKAGE is currently restricted as an import in Noble ✘"
48
+ exit 1
49
+ fi
50
+ done
You can’t perform that action at this time.
0 commit comments