From cdd459c29778093bf47966533faa1be103bc312a Mon Sep 17 00:00:00 2001 From: freddydk Date: Tue, 19 Nov 2024 10:00:05 +0100 Subject: [PATCH] get token for repo --- Actions/Github-Helper.psm1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Actions/Github-Helper.psm1 b/Actions/Github-Helper.psm1 index f372fa261..4e1ebc98f 100644 --- a/Actions/Github-Helper.psm1 +++ b/Actions/Github-Helper.psm1 @@ -629,14 +629,16 @@ function GetHeaders { param ( [string] $token, [string] $accept = "application/vnd.github+json", - [string] $apiVersion = "2022-11-28" + [string] $apiVersion = "2022-11-28", + [string] $api_url = $ENV:GITHUB_API_URL, + [string] $repository = $ENV:GITHUB_REPOSITORY ) $headers = @{ "Accept" = $accept "X-GitHub-Api-Version" = $apiVersion } if (![string]::IsNullOrEmpty($token)) { - $realToken = GetRealToken -token $token + $realToken = GetRealToken -token $token -api_url $api_url -repository $repository $headers["Authorization"] = "token $realToken" } return $headers