|
1 | 1 | package it.krzeminski.githubactionstyping
|
2 | 2 |
|
3 |
| -import it.krzeminski.githubactionstyping.github.getBooleanInput |
4 | 3 | import it.krzeminski.githubactionstyping.parsing.TypesManifest
|
5 | 4 | import it.krzeminski.githubactionstyping.parsing.parseManifest
|
6 | 5 | import it.krzeminski.githubactionstyping.parsing.parseTypesManifest
|
@@ -30,27 +29,30 @@ fun manifestsToReport(manifest: String, typesManifest: String): Pair<Boolean, St
|
30 | 29 | throw IllegalStateException("The same set of outputs should exist in action manifest and types manifest!")
|
31 | 30 | }
|
32 | 31 |
|
33 |
| - if (getBooleanInput("verbose")) { |
34 |
| - println("Action's manifest:") |
35 |
| - println(manifest) |
| 32 | + printlnDebug("Action's manifest:") |
| 33 | + printlnDebug(manifest) |
36 | 34 |
|
37 |
| - println("Parsed manifest:") |
38 |
| - println(parsedManifest) |
| 35 | + printlnDebug("Parsed manifest:") |
| 36 | + printlnDebug(parsedManifest) |
39 | 37 |
|
40 |
| - println("Action's types manifest:") |
41 |
| - println(typesManifest) |
| 38 | + printlnDebug("Action's types manifest:") |
| 39 | + printlnDebug(typesManifest) |
42 | 40 |
|
43 |
| - println("Parsed types manifest:") |
44 |
| - println(parsedTypesManifest) |
| 41 | + printlnDebug("Parsed types manifest:") |
| 42 | + printlnDebug(parsedTypesManifest) |
45 | 43 |
|
46 |
| - println() |
47 |
| - println("==============================================") |
48 |
| - println() |
49 |
| - } |
| 44 | + printlnDebug() |
| 45 | + printlnDebug("==============================================") |
| 46 | + printlnDebug() |
50 | 47 |
|
51 | 48 | val validationResult = parsedTypesManifest.validate()
|
52 | 49 | val isValid = validationResult.overallResult is ItemValidationResult.Valid
|
53 | 50 | val report = validationResult.toPlaintextReport()
|
54 | 51 |
|
55 | 52 | return Pair(isValid, report)
|
56 | 53 | }
|
| 54 | + |
| 55 | +private fun printlnDebug(string: Any? = null) = |
| 56 | + (string ?: "").toString().lines() |
| 57 | + .map { "::debug::$it" } |
| 58 | + .forEach { println(it) } |
0 commit comments