diff options
author | Francois Kritzinger <francois@codesynthesis.com> | 2024-04-26 07:18:33 +0200 |
---|---|---|
committer | Francois Kritzinger <francois@codesynthesis.com> | 2024-05-13 09:17:32 +0200 |
commit | c4a4e3a00b39f67ec4be2712bbff20c53e6141d8 (patch) | |
tree | 363b0d4f76b85c5e1da1ff39fcf82660e7cca712 /mod/mod-ci-github-gh.cxx | |
parent | 5114d1250b82a0d151ef7bd365fb7ed4afea83dd (diff) |
Support GitHub conclusion in check run create/update
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; |