summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-09 01:31:45 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-09 01:31:45 +0100
commiteb1edce15ab3e0ea085afe41797df591ba303565 (patch)
tree085ddf487a8229a433ec5cc0dcd0a5d67c4e8348 /src
parentec580656085dfeebcae1aff58c372f8b56f97df2 (diff)
downloadSkyHanniChangelogBuilder-eb1edce15ab3e0ea085afe41797df591ba303565.tar.gz
SkyHanniChangelogBuilder-eb1edce15ab3e0ea085afe41797df591ba303565.tar.bz2
SkyHanniChangelogBuilder-eb1edce15ab3e0ea085afe41797df591ba303565.zip
add option to exclude_from_changelog
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/Main.kt19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/kotlin/Main.kt b/src/main/kotlin/Main.kt
index 5a5b564..32e5b13 100644
--- a/src/main/kotlin/Main.kt
+++ b/src/main/kotlin/Main.kt
@@ -62,6 +62,7 @@ fun readPrs(prs: List<PullRequest>, firstPr: Int, hideWhenError: Boolean, title:
val categories = mutableListOf<Category>()
val allChanges = mutableListOf<Change>()
var errors = 0
+ var excluded = 0
var done = 0
// TODO find better solution for this sorting logic
val filtered = when (whatToDo) {
@@ -81,6 +82,15 @@ fun readPrs(prs: List<PullRequest>, firstPr: Int, hideWhenError: Boolean, title:
val body = pr.body
val description = body?.split(System.lineSeparator()) ?: emptyList()
+ if (description.isNotEmpty()) {
+ val last = description.last()
+ if (last == "exclude_from_changelog") {
+ println("")
+ println("Excluded #$number ($prLink)")
+ excluded++
+ continue
+ }
+ }
try {
allChanges.addAll(parseChanges(description, prLink, categories))
done++
@@ -100,8 +110,13 @@ fun readPrs(prs: List<PullRequest>, firstPr: Int, hideWhenError: Boolean, title:
print(categories, allChanges, type, title)
}
println("")
- println("Found $errors PRs with errors")
- println("Loaded $done PRs correctly")
+ if (excluded > 0) {
+ println("Excluded $excluded PRs.")
+ }
+ if (errors > 0) {
+ println("Found $errors PRs with errors.")
+ }
+ println("Loaded $done PRs correctly.")
if (errors > 0) {
if (hideWhenError) {
exitProcess(-1)