Skip to content

Commit d1b4bd2

Browse files
committed
👷 [ci] Simplify git-cliff installation in publish workflow
- Replace runtime GitHub API release lookup with a pinned download URL (v2.10.1) to avoid API auth/rate issues and speed up CI - Remove custom request headers and UseBasicParsing; use a straightforward Invoke-WebRequest to fetch the ZIP - Tweak comment and behavior: add git-cliff to PATH for the session and still export PATH to GITHUB_ENV (no claim about persisting) - Preserve extraction and validation steps (fail if git-cliff.exe is missing) - Note: pins git-cliff version; update URL when upgrading the tool Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
1 parent ebe748e commit d1b4bd2

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -245,35 +245,20 @@ jobs:
245245
- name: Install git-cliff
246246
if: ${{ github.event_name != 'workflow_dispatch' || env.CREATE_RELEASE_INPUT != 'false' }}
247247
run: |
248-
Write-Host "Installing git-cliff (discovering latest release asset)..."
249-
250-
$api = "https://api.github.com/repos/orhun/git-cliff/releases/latest"
251-
$headers = @{ 'User-Agent' = 'GitHub Actions' }
252-
if ($env:GITHUB_TOKEN) { $headers['Authorization'] = "token $env:GITHUB_TOKEN" }
253-
254-
# Query the latest release and pick the asset matching the platform pattern.
255-
$release = Invoke-RestMethod -Uri $api -Headers $headers
256-
$asset = $release.assets | Where-Object { $_.name -match 'x86_64-pc-windows-msvc\.zip$' } | Select-Object -First 1
257-
258-
if (-not $asset) {
259-
throw "No matching git-cliff asset found in latest release. Checked pattern: 'x86_64-pc-windows-msvc.zip'"
260-
}
261-
262-
$downloadUrl = $asset.browser_download_url
248+
Write-Host "Installing git-cliff..."
249+
$downloadUrl = "https://github.com/orhun/git-cliff/releases/download/v2.10.1/git-cliff-2.10.1-x86_64-pc-windows-msvc.zip"
263250
$zipPath = Join-Path $env:RUNNER_TEMP "git-cliff.zip"
264251
$extractPath = Join-Path $env:RUNNER_TEMP "git-cliff"
265252
266-
Write-Host "Downloading $($asset.name) from $downloadUrl"
267-
Invoke-WebRequest -Uri $downloadUrl -OutFile $zipPath -Headers $headers -UseBasicParsing
268-
253+
Invoke-WebRequest -Uri $downloadUrl -OutFile $zipPath
269254
Expand-Archive -Path $zipPath -DestinationPath $extractPath -Force
270255
271256
$exePath = Join-Path $extractPath "git-cliff.exe"
272257
if (-not (Test-Path $exePath)) {
273258
throw "git-cliff.exe not found after extraction"
274259
}
275260
276-
# Add to PATH for this session and persist for later steps
261+
# Add to PATH for this session
277262
$env:PATH = "$extractPath;$env:PATH"
278263
"PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
279264

0 commit comments

Comments
 (0)