RunChecks executes the checks command with the given configuration.
(config ChecksConfig)
| 119 | |
| 120 | // RunChecks executes the checks command with the given configuration. |
| 121 | func RunChecks(config ChecksConfig) error { |
| 122 | checksLog.Printf("Running checks: pr=%s, repo=%s", config.PRNumber, config.Repo) |
| 123 | |
| 124 | result, err := FetchChecksResult(config.Repo, config.PRNumber) |
| 125 | if err != nil { |
| 126 | return err |
| 127 | } |
| 128 | |
| 129 | if config.JSONOutput { |
| 130 | return printChecksJSON(result) |
| 131 | } |
| 132 | |
| 133 | return printChecksText(result) |
| 134 | } |
| 135 | |
| 136 | // FetchChecksResult fetches check runs and statuses for a PR and returns a classified result. |
| 137 | // This function is exported for use in tests and other packages. |
no test coverage detected