Replace Towncrier with GitHub releases + labels. (#2966)

* Set up GitHub generated release notes.

* Remove Towncrier from the release script.

* Add changelog failures for Labels with Danger and stop requesting a changelog file.

* Update changelog documentation.
This commit is contained in:
Doug
2024-06-25 12:07:01 +01:00
committed by GitHub
parent 567f22b806
commit 82823c94ce
10 changed files with 62 additions and 274 deletions
+11 -8
View File
@@ -5,6 +5,9 @@ SwiftLint.lint(inline: true)
let danger = Danger()
// All of the new and modified files together.
let editedFiles = danger.git.modifiedFiles + danger.git.createdFiles
// Warn when there is a big PR
if (danger.github.pullRequest.additions ?? 0) > 1000 {
warn("This pull request seems relatively large. Please consider splitting it into multiple smaller ones.")
@@ -15,14 +18,6 @@ if danger.github.pullRequest.body?.isEmpty ?? true {
warn("Please provide a description for this PR.")
}
// Request a changelog for each app change
let editedFiles = danger.git.modifiedFiles + danger.git.createdFiles
let changelogFiles = editedFiles.filter { $0.hasPrefix("changelog.d/") }
if editedFiles.count > 0, changelogFiles.isEmpty {
warn("Please add a changelog.")
}
// Check for a ticket number
if let ticketNumberRegex = try? NSRegularExpression(pattern: "#\\d+") {
let missingTicketNumber = !danger.git.commits.filter {
@@ -84,3 +79,11 @@ let hasPngs = !editedFiles.filter { $0.lowercased().contains(".xcassets") && $0.
if hasPngs {
warn("You seem to have made changes to some resource images. Please consider using an SVG or PDF.")
}
if danger.github.pullRequest.title.hasSuffix("…") {
fail("Please provide a complete title that can be used as a changelog entry.")
}
if danger.github.issue.labels.filter({ $0.name.hasPrefix("pr-") }).count != 1 {
fail("Please add a `pr-` label to categorise the changelog entry.")
}