aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Kritzinger <francois@codesynthesis.com>2024-02-26 18:00:30 +0200
committerFrancois Kritzinger <francois@codesynthesis.com>2024-05-08 15:51:48 +0200
commit2059dd12d36b97e5b808ff04c0a0bd4355eb6a37 (patch)
treee36cc93e8c94f59fc6767dd0c4cf49639a220b78
parenta0d36b379f6eb8aba4f84debdfbbaac528447a49 (diff)
Pass no_fail curl flag
-rw-r--r--mod/mod-ci-github.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/mod/mod-ci-github.cxx b/mod/mod-ci-github.cxx
index 7ca9ff3..fbe2fec 100644
--- a/mod/mod-ci-github.cxx
+++ b/mod/mod-ci-github.cxx
@@ -218,12 +218,9 @@ namespace brep
// Pass --include to print the HTTP status line (followed by the response
// headers) so that we can get the response status code.
//
- // Pass --no-fail to disable the --fail option added by butl::curl which
- // causes curl to exit with status 22 in case of an error HTTP response
- // status code (>= 400) otherwise we can't get the status code.
- //
- // @@ KAREN: fix butl::curl (detect if --no-fail or --fail is passed
- // explicitly).
+ // Suppress the --fail option which causes curl to exit with status 22
+ // in case of an error HTTP response status code (>= 400) otherwise we
+ // can't get the status code.
//
// Note that butl::curl also adds --location to make curl follow redirects
// (which is recommended by GitHub).
@@ -237,9 +234,10 @@ namespace brep
curl c (path ("-"),
path ("-"), // Write response to curl::in.
process::pipe (errp.in.get (), move (errp.out)),
- curl::post, "https://api.github.com/" + ep,
+ curl::post,
+ curl::flags::no_fail,
+ "https://api.github.com/" + ep,
"--include", // Output response headers for status code.
- "--no-fail", // Don't exit with 22 if response status code >= 400.
"--header", "Accept: application/vnd.github+json",
"--header", "X-GitHub-Api-Version: 2022-11-28",
move (hdr_opts));