Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/PSModule/GitHub into createApp
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Feb 7, 2025
2 parents 36f68dd + 18e433d commit dbfa63a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/functions/public/API/Invoke-GitHubAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,19 @@ filter Invoke-GitHubAPI {
}
$headers = [pscustomobject]$headers
if ($headers.'x-ratelimit-reset') {
$headers.'x-ratelimit-reset' = [DateTime]::UnixEpoch.AddSeconds($headers.'x-ratelimit-reset').ToString('s')
$headers.'x-ratelimit-reset' = [DateTime]::UnixEpoch.AddSeconds(
$headers.'x-ratelimit-reset'
).ToString('s')
}
if ($headers.'Date') {
$headers.'Date' = [DateTime]::Parse(($headers.'Date').Replace('UTC', '').Trim()).ToString('s')
$headers.'Date' = [DateTime]::Parse(
($headers.'Date').Replace('UTC', '').Trim()
).ToString('s')
}
if ($headers.'github-authentication-token-expiration') {
$headers.'github-authentication-token-expiration' = [DateTime]::Parse(($headers.'github-authentication-token-expiration').Replace('UTC', '').Trim()).ToString('s')
$headers.'github-authentication-token-expiration' = [DateTime]::Parse(
($headers.'github-authentication-token-expiration').Replace('UTC', '').Trim()
).ToString('s')
}
$sortedProperties = $headers.PSObject.Properties.Name | Sort-Object
$headers = $headers | Select-Object $sortedProperties
Expand Down

0 comments on commit dbfa63a

Please sign in to comment.