aboutsummaryrefslogtreecommitdiffstats
path: root/src/github.rs
diff options
context:
space:
mode:
authorTeddy Wing2017-11-10 03:08:29 +0100
committerTeddy Wing2017-11-10 03:08:29 +0100
commit47cd439b69c4c19074e6056d299eb704c375727b (patch)
tree072726dfb6f625df10d52c21c22518f4e5218986 /src/github.rs
parent274f22abbd33e083b52fc5ade828050b61a22f85 (diff)
downloadkipper-47cd439b69c4c19074e6056d299eb704c375727b.tar.bz2
update_commit_status(): Pass authorization header with request
Authenticate our GitHub request with an `Authorization` header and API token.
Diffstat (limited to 'src/github.rs')
-rw-r--r--src/github.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/github.rs b/src/github.rs
index 55c7ce0..de4f602 100644
--- a/src/github.rs
+++ b/src/github.rs
@@ -4,7 +4,7 @@ extern crate reqwest;
use std::collections::HashMap;
use std::fmt;
-use self::reqwest::header::{Accept, qitem};
+use self::reqwest::header::{Accept, Authorization, Bearer, qitem};
use pull_request::CommitRef;
@@ -64,6 +64,13 @@ pub fn update_commit_status(
vec![qitem("application/vnd.github.v3+json".parse().unwrap())]
)
)
+ .header(
+ Authorization(
+ Bearer {
+ token: "token".to_owned()
+ }
+ )
+ )
.json(&params)
.send()
.unwrap();