mirror of
https://github.com/containers/podman.git
synced 2026-07-10 15:25:00 -04:00
Use GH token to download Podman release in utils.ps1
This is to avoid requests failing due to GitHub's non-authenticated request rate limit. See [this PR check failure](https://github.com/podman-container-tools/podman-sandbox/actions/runs/26632208486/job/78483599334?pr=5) for an example of such a failure. Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
This commit is contained in:
@@ -17,7 +17,11 @@ function Get-Podman-Setup-From-GitHub {
|
||||
|
||||
Write-Host "Downloading the $arch $version Podman windows setup from GitHub..."
|
||||
$apiUrl = "https://api.github.com/repos/containers/podman/releases/$version"
|
||||
$response = Invoke-RestMethod -Uri $apiUrl -Headers @{"User-Agent"="PowerShell"} -ErrorAction Stop
|
||||
$headers = @{"User-Agent"="PowerShell"}
|
||||
if ($env:GITHUB_TOKEN) {
|
||||
$headers["Authorization"] = "Bearer $env:GITHUB_TOKEN"
|
||||
}
|
||||
$response = Invoke-RestMethod -Uri $apiUrl -Headers $headers -ErrorAction Stop
|
||||
$latestTag = $response.tag_name
|
||||
Write-Host "Looking for an asset named ""podman-installer-windows-$arch.exe"""
|
||||
$downloadAsset = $response.assets | Where-Object { $_.name -eq "podman-installer-windows-$arch.exe" } | Select-Object -First 1
|
||||
|
||||
Reference in New Issue
Block a user