MCPcopy
hub / github.com/danger/danger-js / handleResults

Method handleResults

source/runner/Executor.ts:139–159  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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 *

Callers 3

runDangerMethod · 0.95
_executor.test.tsFile · 0.80
runDangerSubprocessFunction · 0.80

Calls 3

validateResultsFunction · 0.90

Tested by

no test coverage detected