fix: github commit should use common headers
Some checks failed
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
Rust / build (push) Has been cancelled
ci/woodpecker/push/tag-created Pipeline was successful

This commit is contained in:
Paul Campbell 2024-06-30 19:30:22 +01:00
parent ae7933c79e
commit 73ab149aba

View file

@ -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,