Skip to content

Commit

Permalink
get token for repo
Browse files Browse the repository at this point in the history
  • Loading branch information
freddydk committed Nov 19, 2024
1 parent 9ba3af2 commit cdd459c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Actions/Github-Helper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cdd459c

Please sign in to comment.