File tree 3 files changed +29
-0
lines changed
3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,15 @@ jobs:
102
102
with :
103
103
version : v1.46.0
104
104
105
+ check-enterprise-imports :
106
+ name : check/enterprise-imports
107
+ timeout-minutes : 5
108
+ runs-on : ubuntu-latest
109
+ steps :
110
+ - uses : actions/checkout@v3
111
+ - name : Check imports of enterprise code
112
+ run : ./scripts/check_enterprise_imports.sh
113
+
105
114
style-lint-shellcheck :
106
115
name : style/lint/shellcheck
107
116
timeout-minutes : 5
Original file line number Diff line number Diff line change @@ -116,6 +116,7 @@ lint: lint/shellcheck lint/go
116
116
.PHONY : lint
117
117
118
118
lint/go :
119
+ ./scripts/check_enterprise_imports.sh
119
120
golangci-lint run
120
121
.PHONY : lint/go
121
122
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # This file checks all our AGPL licensed source files to be sure they don't
4
+ # import any enterprise licensed packages (the inverse is fine).
5
+
6
+ set -euo pipefail
7
+ # shellcheck source=scripts/lib.sh
8
+ source " $( dirname " ${BASH_SOURCE[0]} " ) /lib.sh"
9
+ cdroot
10
+
11
+ set +e
12
+ find . -regex " .*\.go" | grep -v " ./enterprise" | xargs grep -n " github.com/coder/coder/enterprise"
13
+ # reverse the exit code because we want this script to fail if grep finds anything.
14
+ status=$?
15
+ set -e
16
+ if [ $status -eq 0 ]; then
17
+ error " AGPL code cannot import enterprise!"
18
+ fi
19
+ log " AGPL imports OK"
You can’t perform that action at this time.
0 commit comments