mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 08:25:40 +00: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:
parent
2393c05d28
commit
7c7d56a0fb
1 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue