diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-09 01:31:45 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2024-03-09 01:31:45 +0100 |
commit | eb1edce15ab3e0ea085afe41797df591ba303565 (patch) | |
tree | 085ddf487a8229a433ec5cc0dcd0a5d67c4e8348 /src/main/kotlin/Main.kt | |
parent | ec580656085dfeebcae1aff58c372f8b56f97df2 (diff) | |
download | SkyHanniChangelogBuilder-eb1edce15ab3e0ea085afe41797df591ba303565.tar.gz SkyHanniChangelogBuilder-eb1edce15ab3e0ea085afe41797df591ba303565.tar.bz2 SkyHanniChangelogBuilder-eb1edce15ab3e0ea085afe41797df591ba303565.zip |
add option to exclude_from_changelog
Diffstat (limited to 'src/main/kotlin/Main.kt')
-rw-r--r-- | src/main/kotlin/Main.kt | 19 |
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) |