Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Aug 11, 2024
1 parent 7303da4 commit 7743fae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/GitHub.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ Describe 'GitHub' {
'X-GitHub-Api-Version' = Get-GitHubConfig -Name ApiVersion
}

$encryptedString = $AccessToken | ConvertFrom-SecureString
$secureStringRecovered = $encryptedString | ConvertTo-SecureString
$token = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($secureStringRecovered))

$AccessToken = Get-GitHubConfig -Name AccessToken
if ($AccessToken) {
$Token = $AccessToken | ConvertFrom-SecureString -AsPlainText
$headers['Authorization'] = "Bearer $Token"
$headers['Authorization'] = "Bearer $token"
}

Remove-HashtableEntry -Hashtable $headers -NullOrEmptyValues
Expand Down

0 comments on commit 7743fae

Please sign in to comment.