Skip to content

Commit 4c05cea

Browse files
committed
Add a Danger check for semantic commits.
1 parent 2c5c749 commit 4c05cea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Dangerfile.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ if hasPngs {
3939
}
4040

4141
// Check for nice PR titles
42+
let prTitle = danger.github.pullRequest.title
4243
let fixesRegex = try! Regex("(Fixes|Fix) #\\d+")
43-
if danger.github.pullRequest.title.hasSuffix("") || danger.github.pullRequest.title.starts(with: fixesRegex) {
44+
let semanticRegex = try! Regex("\\w+\\(\\w+\\):")
45+
if prTitle.hasSuffix("") || prTitle.starts(with: fixesRegex) || prTitle.starts(with: semanticRegex) {
4446
fail("Please provide a complete title that can be used as a changelog entry.")
4547
}
4648

0 commit comments

Comments
 (0)