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 repo_details = &github.repo_details;
|
||||||
let hostname = repo_details.forge.hostname();
|
let hostname = repo_details.forge.hostname();
|
||||||
let repo_path = &repo_details.repo_path;
|
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!(
|
let url = network::NetUrl::new(format!(
|
||||||
"https://api.{hostname}/repos/{repo_path}/commits/{commit}/statuses"
|
"https://api.{hostname}/repos/{repo_path}/commits/{commit}/statuses"
|
||||||
));
|
));
|
||||||
|
let headers = github::webhook::headers(repo_details.forge.token());
|
||||||
let headers = network::NetRequestHeaders::new()
|
|
||||||
.with("X-GitHub-Api-Version", "2022-11-28")
|
|
||||||
.with("Authorization", format!("Bearer: {token}").as_str());
|
|
||||||
|
|
||||||
let request = network::NetRequest::new(
|
let request = network::NetRequest::new(
|
||||||
network::RequestMethod::Get,
|
network::RequestMethod::Get,
|
||||||
url,
|
url,
|
||||||
|
|
Loading…
Reference in a new issue