From 73ab149aba4f6aac124b6a127514a443be91b914 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 30 Jun 2024 19:30:22 +0100 Subject: [PATCH] fix: github commit should use common headers --- crates/forge-github/src/commit.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crates/forge-github/src/commit.rs b/crates/forge-github/src/commit.rs index 9694487..78c6d98 100644 --- a/crates/forge-github/src/commit.rs +++ b/crates/forge-github/src/commit.rs @@ -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,