You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am building an automated packaging workflow using evergreen. At some point, i noticed that my variable which would hold the download url which is dynamically retrieved via evergreen, was null. Upon checking closer i can see that i get ratelimited:
PS C:\NIP_Software\Scripts> $DownloadURL = Get-EvergreenApp -Name $AppName | Where-Object { if (!$_.Architecture -or $_.Architecture -eq "x64") {$true} else {$false} } | Where-Object { if (!$_.Channel -or $_.Channel -eq $sourcechannel) {$true} else {$false} } | Where-Object { if (!$_.Type -or $_.Type -eq $sourcepackagetype) {$true} else {$false} } | Where-Object { if (!$_.Platform -or $_.Platform -eq $sourceplatform) {$true} else {$false} } | Where-Object { if (!$_.Language -or $_.Language -eq $sourcelanguage) {$true} else {$false} } | Select -ExpandProperty URI | Select-Object -First 1
WARNING: Get-GitHubRateLimit: Requests to GitHub are being rate limited.
PS C:\NIP_Software\Scripts> Get-EvergreenApp -Name $appname
WARNING: Get-GitHubRateLimit: Requests to GitHub are being rate limited.
Version URI
------- ---
RateLimited https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting
PS C:\NIP_Software\Scripts> $AppName = GitForWindows
GitForWindows : The term 'GitForWindows' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:12
+ $AppName = GitForWindows
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (GitForWindows:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\NIP_Software\Scripts> $Arch = "x64"
PS C:\NIP_Software\Scripts> $AppType = "EXE"
PS C:\NIP_Software\Scripts>
PS C:\NIP_Software\Scripts> $ThisApp = (Get-EvergreenApp $($AppName) | Where-Object {$_.Architecture -eq $($Arch) -and $_.Type -eq $($AppType).ToLower() -and $_.URI -notlike "*PortableGit*"})
WARNING: Get-GitHubRateLimit: Requests to GitHub are being rate limited.
PS C:\NIP_Software\Scripts> #[version]$LatestVersion = $ThisApp.Version
PS C:\NIP_Software\Scripts> $SourceUrl = $ThisApp.URI
PS C:\NIP_Software\Scripts> # Evergreen version returns 3 digit version so obtain 4 digit version from URI
PS C:\NIP_Software\Scripts> [version]$LatestVersion = (((($ThisApp).URI -split "/")[7]) -replace '^v') -replace '.windows'
Cannot convert value "" to type "System.Version". Error: "Versjonsstrengdelen var for kort eller for lang."
At line:1 char:1
+ [version]$LatestVersion = (((($ThisApp).URI -split "/")[7]) -replace ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException
+ FullyQualifiedErrorId : RuntimeException
How can i avoid this / solve this somehow? If i get ratelimited during a workflow it would be pretty stupid and would require manual action, thus removing the whole point of the "workflow" haha
Version
2309.840
What PowerShell edition/s are you running Evergreen on?
Windows PowerShell
Which operating system/s are you running Evergreen on?
You can authenticate to the GitHub API, and save the authentication token to $Env:GH_TOKEN or $Env:GITHUB_TOKEN. Evergreen will then use the token when querying the API, and you won't be rate limited.
You can authenticate to the GitHub API, and save the authentication token to $Env:GH_TOKEN or $Env:GITHUB_TOKEN. Evergreen will then use the token when querying the API, and you won't be rate limited.
What happened?
I am building an automated packaging workflow using evergreen. At some point, i noticed that my variable which would hold the download url which is dynamically retrieved via evergreen, was null. Upon checking closer i can see that i get ratelimited:
How can i avoid this / solve this somehow? If i get ratelimited during a workflow it would be pretty stupid and would require manual action, thus removing the whole point of the "workflow" haha
Version
2309.840
What PowerShell edition/s are you running Evergreen on?
Windows PowerShell
Which operating system/s are you running Evergreen on?
Windows 10+
Have you reviewed the documentation?
Verbose output
The text was updated successfully, but these errors were encountered: