diff options
Diffstat (limited to 'mod/mod-ci-github-gh.cxx')
-rw-r--r-- | mod/mod-ci-github-gh.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mod/mod-ci-github-gh.cxx b/mod/mod-ci-github-gh.cxx index 44eb7ca..5c4809c 100644 --- a/mod/mod-ci-github-gh.cxx +++ b/mod/mod-ci-github-gh.cxx @@ -41,6 +41,35 @@ namespace brep } string + gh_to_conclusion (result_status rs) + { + switch (rs) + { + case result_status::success: + case result_status::warning: + return "SUCCESS"; + + case result_status::error: + case result_status::abort: + case result_status::abnormal: + return "FAILURE"; + + // Valid values we should never encounter. + // + case result_status::skip: + case result_status::interrupt: + throw invalid_argument ("unexpected result_status value: " + + to_string (rs)); + + // Invalid value. + // + default: + throw invalid_argument ("invalid result_status value: " + + to_string (static_cast<int> (rs))); + } + } + + string gh_check_run_name (const build& b, const build_queued_hints* bh) { string r; |