aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-ci-github-gh.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-04-26 11:02:29 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-06-05 09:12:46 +0200
commit823eb2bc447d274789b8d1d49bdba12e68bfabed (patch)
treeddbd4a8f399ecfc717a5d6d1e64922bddb65079d /mod/mod-ci-github-gh.cxx
parentafdfd27f56f8e9bf462912aff4bc318790832254 (diff)
Review
Diffstat (limited to 'mod/mod-ci-github-gh.cxx')
-rw-r--r--mod/mod-ci-github-gh.cxx17
1 files changed, 5 insertions, 12 deletions
diff --git a/mod/mod-ci-github-gh.cxx b/mod/mod-ci-github-gh.cxx
index 5c4809c..c97f938 100644
--- a/mod/mod-ci-github-gh.cxx
+++ b/mod/mod-ci-github-gh.cxx
@@ -20,9 +20,6 @@ namespace brep
case build_state::queued: return "QUEUED";
case build_state::building: return "IN_PROGRESS";
case build_state::built: return "COMPLETED";
- default:
- throw invalid_argument ("invalid build_state value: " +
- to_string (static_cast<int> (st)));
}
}
@@ -36,19 +33,21 @@ namespace brep
else if (s == "IN_PROGRESS") return build_state::building;
else if (s == "COMPLETED") return build_state::built;
else
- throw invalid_argument ("invalid GitHub check run status: '" + s +
+ throw invalid_argument ("unexpected GitHub check run status: '" + s +
'\'');
}
string
- gh_to_conclusion (result_status rs)
+ gh_to_conclusion (result_status rs, bool warning_success)
{
switch (rs)
{
case result_status::success:
- case result_status::warning:
return "SUCCESS";
+ case result_status::warning:
+ return warning_success ? "SUCCESS" : "FAILURE";
+
case result_status::error:
case result_status::abort:
case result_status::abnormal:
@@ -60,12 +59,6 @@ namespace brep
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)));
}
}