Skip to content

Commit 3275e8c

Browse files
committed
fix: enhance error handling for GitHub releases fetching in update-dependency script
1 parent 1a4e26b commit 3275e8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

updater/scripts/update-dependency.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ param(
1818
[string] $Tag = ''
1919
)
2020

21+
$ErrorActionPreference = 'Stop'
2122
Set-StrictMode -Version latest
2223
. "$PSScriptRoot/common.ps1"
2324

@@ -171,7 +172,10 @@ if ("$Tag" -eq '') {
171172
$owner, $repo = $Matches[1], $Matches[2]
172173

173174
# Fetch releases from GitHub API
174-
$releases = @(gh api "repos/$owner/$repo/releases" --jq '.[] | {tag_name: .tag_name, name: .name}' | ConvertFrom-Json)
175+
$releases = @(gh api "repos/$owner/$repo/releases" --paginate --jq '.[] | {tag_name: .tag_name, name: .name}' | ConvertFrom-Json)
176+
if ($LASTEXITCODE -ne 0) {
177+
throw "Failed to fetch GitHub releases from $owner/$repo (exit code: $LASTEXITCODE)"
178+
}
175179

176180
# Find tags that have matching release titles
177181
$validTags = @{}

0 commit comments

Comments
 (0)