Skip to content

Commit

Permalink
scc: use authenticated requests for github
Browse files Browse the repository at this point in the history
[AU scc:3.1.0.20221202]
  • Loading branch information
naveen521kk committed Jan 10, 2023
1 parent 2201291 commit b54b003
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scc/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ import-module au

$github_api_url = 'https://api.github.com/repos/boyter/scc/releases'
function global:au_GetLatest {
$contentFetched = Invoke-WebRequest $github_api_url | ConvertFrom-Json
# authentication token is stored in $GITHUB_TOKEN
if ($env:github_api_key) {
$headers = @{
Authorization="$($env:github_api_key)"
}
}
else {
$headers = @{}
}
$contentFetched = Invoke-WebRequest -Headers $headers $github_api_url | ConvertFrom-Json
$i = 0
$stableRelease = $contentFetched[0]
while ($contentFetched[$i].prerelease -eq $true) {
Expand Down

0 comments on commit b54b003

Please sign in to comment.