forked from kemitix/git-next
fix: github commit should use common headers
This commit is contained in:
parent
ae7933c79e
commit
73ab149aba
1 changed files with 1 additions and 8 deletions
|
@ -12,17 +12,10 @@ pub async fn status(github: &github::Github, commit: &git::Commit) -> git::forge
|
|||
let repo_details = &github.repo_details;
|
||||
let hostname = repo_details.forge.hostname();
|
||||
let repo_path = &repo_details.repo_path;
|
||||
let api_token = &repo_details.forge.token();
|
||||
use secrecy::ExposeSecret;
|
||||
let token = api_token.expose_secret();
|
||||
let url = network::NetUrl::new(format!(
|
||||
"https://api.{hostname}/repos/{repo_path}/commits/{commit}/statuses"
|
||||
));
|
||||
|
||||
let headers = network::NetRequestHeaders::new()
|
||||
.with("X-GitHub-Api-Version", "2022-11-28")
|
||||
.with("Authorization", format!("Bearer: {token}").as_str());
|
||||
|
||||
let headers = github::webhook::headers(repo_details.forge.token());
|
||||
let request = network::NetRequest::new(
|
||||
network::RequestMethod::Get,
|
||||
url,
|
||||
|
|
Loading…
Reference in a new issue