Skip to content

Commit

Permalink
Add a Danger check for semantic commits.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Dec 17, 2024
1 parent 2c5c749 commit d65383b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dangerfile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ if hasPngs {
}

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

Expand Down

0 comments on commit d65383b

Please sign in to comment.