File tree 2 files changed +26
-4
lines changed
2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -u
3
+
4
+ if ! git diff-index --quiet HEAD --; then
5
+ git diff-index HEAD --
6
+ echo " there are uncommitted changes, please commit them before running this check"
7
+ exit 1
8
+ fi
9
+
10
+ success=true
11
+
12
+ if ! make generate-json-schema; then
13
+ echo " Generating json schema failed"
14
+ success=false
15
+ fi
16
+
17
+ if ! git diff-index --quiet HEAD --; then
18
+ git diff-index HEAD --
19
+ echo " JSON schema drift detected!"
20
+ success=false
21
+ fi
22
+
23
+ if ! $success ; then
24
+ exit 1
25
+ fi
Original file line number Diff line number Diff line change @@ -132,10 +132,7 @@ check-go-mod-tidy:
132
132
133
133
check-json-schema-drift :
134
134
$(call title,Ensure there is no drift between the JSON schema and the code)
135
- @git diff-index --quiet HEAD -- || (echo " there are uncommitted changes, please commit them before running this check" && false)
136
- @make generate-json-schema || (echo " $( RED) $( BOLD) JSON schema drift detected!$( RESET) " && false)
137
- @git diff-index --quiet HEAD -- || (echo " $( RED) $( BOLD) JSON schema drift detected!$( RESET) " && false)
138
-
135
+ @.github/scripts/json-schema-drift-check.sh
139
136
140
137
# # Testing targets #################################
141
138
You can’t perform that action at this time.
0 commit comments