From eb1edce15ab3e0ea085afe41797df591ba303565 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 9 Mar 2024 01:31:45 +0100 Subject: add option to exclude_from_changelog --- src/main/kotlin/Main.kt | 19 +++++++++++++++++-- 1 file 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, firstPr: Int, hideWhenError: Boolean, title: val categories = mutableListOf() val allChanges = mutableListOf() 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, 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, 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) -- cgit