File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,21 @@ type GitCommit struct {
34
34
DCOCoauthorTag string `json:"dcoCoauthorTag"`
35
35
}
36
36
37
+ const (
38
+ dependabot = "dependabot[bot]"
39
+ konflux = "red-hat-konflux"
40
+ )
41
+
37
42
func validate (commit GitCommit ) error {
38
43
var errs error
44
+
39
45
if "<" + commit .Author + ">" == commit .AuthorEmailLocal {
40
46
errs = errors .Join (errs , fmt .Errorf ("missing author name - equals to email local part" ))
41
47
}
48
+ if strings .Contains (commit .Author , konflux ) {
49
+ fmt .Printf ("git commit authored by konflux bot\n " )
50
+ return nil
51
+ }
42
52
if commit .DCOSignTag == "" {
43
53
errs = errors .Join (errs , fmt .Errorf ("DCO signoff trailer missing" ))
44
54
} else {
@@ -58,6 +68,9 @@ func validate(commit GitCommit) error {
58
68
}
59
69
60
70
func expectedDCOSignTag (commit GitCommit ) string {
71
+ if commit .Author == dependabot {
72
+ return fmt .Sprintf ("Signed-off-by: %s" , commit .Author )
73
+ }
61
74
return fmt .Sprintf ("Signed-off-by: %s %s" , commit .Author , commit .AuthorEmail )
62
75
}
63
76
You can’t perform that action at this time.
0 commit comments