Skip to content

Commit 7f38b2c

Browse files
Merge pull request #1447 from shajmakh/bots-cmt-pass-4.18
[release-4.18] tools: pass on bots commits
2 parents 3f1f9d6 + bcf35a1 commit 7f38b2c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/verify-commit/verify-commit.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,21 @@ type GitCommit struct {
3434
DCOCoauthorTag string `json:"dcoCoauthorTag"`
3535
}
3636

37+
const (
38+
dependabot = "dependabot[bot]"
39+
konflux = "red-hat-konflux"
40+
)
41+
3742
func validate(commit GitCommit) error {
3843
var errs error
44+
3945
if "<"+commit.Author+">" == commit.AuthorEmailLocal {
4046
errs = errors.Join(errs, fmt.Errorf("missing author name - equals to email local part"))
4147
}
48+
if strings.Contains(commit.Author, konflux) {
49+
fmt.Printf("git commit authored by konflux bot\n")
50+
return nil
51+
}
4252
if commit.DCOSignTag == "" {
4353
errs = errors.Join(errs, fmt.Errorf("DCO signoff trailer missing"))
4454
} else {
@@ -58,6 +68,9 @@ func validate(commit GitCommit) error {
5868
}
5969

6070
func expectedDCOSignTag(commit GitCommit) string {
71+
if commit.Author == dependabot {
72+
return fmt.Sprintf("Signed-off-by: %s", commit.Author)
73+
}
6174
return fmt.Sprintf("Signed-off-by: %s %s", commit.Author, commit.AuthorEmail)
6275
}
6376

0 commit comments

Comments
 (0)