Skip to content

Commit 9ac3c63

Browse files
committed
Set exit status according to check results
1 parent 919f141 commit 9ac3c63

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ func main() {
4040
fmt.Println(result.JSONReport())
4141
}
4242

43-
// TODO: set exit status according to check results
43+
if !result.Passed() {
44+
os.Exit(errorcodes.ErrGeneric)
45+
}
4446
}

result/result.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ func jsonReportRaw() []byte {
207207
return reportJSON
208208
}
209209

210+
// Passed returns whether the checks passed cumulatively.
211+
func Passed() bool {
212+
return report.Summary.Pass
213+
}
214+
210215
func getProjectReportIndex(projectPath *paths.Path) (bool, int) {
211216
var index int
212217
var projectReport projectReportType

0 commit comments

Comments
 (0)