* Handle the message aspects of running a Dangerfile * * @param {DangerResults} results a JSON representation of the end-state for a Danger run
(results: DangerResults, git?: GitDSL)
| 137 | * @param {DangerResults} results a JSON representation of the end-state for a Danger run |
| 138 | */ |
| 139 | async handleResults(results: DangerResults, git?: GitDSL) { |
| 140 | this.d("Got results back:", results) |
| 141 | if (!results) { |
| 142 | throw new Error( |
| 143 | "Got no results back from the Dangerfile evaluation, this is likely an issue with a custom sub-process exiting early." |
| 144 | ) |
| 145 | } |
| 146 | validateResults(results) |
| 147 | |
| 148 | this.d(`Evaluator settings`, this.options) |
| 149 | |
| 150 | if (this.options.stdoutOnly || this.options.jsonOnly || (this.ciSource && this.ciSource.useEventDSL)) { |
| 151 | await this.handleResultsPostingToSTDOUT(results) |
| 152 | } else { |
| 153 | await this.handleResultsPostingToPlatform(results, git) |
| 154 | } |
| 155 | |
| 156 | if (this.options.failOnErrors && results.fails.length > 0) { |
| 157 | this.process.exitCode = 1 |
| 158 | } |
| 159 | } |
| 160 | /** |
| 161 | * Handle showing results inside the shell. |
| 162 | * |
no test coverage detected