From 47cd439b69c4c19074e6056d299eb704c375727b Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 10 Nov 2017 03:08:29 +0100 Subject: update_commit_status(): Pass authorization header with request Authenticate our GitHub request with an `Authorization` header and API token. --- src/github.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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(¶ms) .send() .unwrap(); -- cgit v1.2.3