Jelajahi Sumber

script: Don't verify authors on commits tagged 'Skip-check: authors'

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3057
Jakob Borg 9 tahun lalu
induk
melakukan
10fe23b8f2
1 mengubah file dengan 13 tambahan dan 0 penghapusan
  1. 13 0
      script/check-authors.go

+ 13 - 0
script/check-authors.go

@@ -76,6 +76,10 @@ func actualAuthorEmails(paths ...string) stringSet {
 			continue
 		}
 
+		if strings.Contains(strings.ToLower(body(hash)), "skip-check: authors") {
+			continue
+		}
+
 		authors.add(author)
 	}
 
@@ -99,6 +103,15 @@ func listedAuthorEmails() stringSet {
 	return authors
 }
 
+func body(hash string) string {
+	cmd := exec.Command("git", "show", "--pretty=format:%b", "-s", hash)
+	bs, err := cmd.Output()
+	if err != nil {
+		log.Fatal("body:", err)
+	}
+	return string(bs)
+}
+
 // A simple string set type
 
 type stringSet map[string]struct{}