Skip to content

Commit

Permalink
Update fontlab-ci.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
twardoch committed Nov 1, 2023
1 parent 34619b3 commit 88a5617
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/fontlab-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,36 @@ jobs:
run: |
$url = "https://download.fontlab.com/fontlab-8/upd-win64.php"
$response = Invoke-WebRequest -Uri $url -Headers @{"Accept-Language"="en-US,en;q=0.9"} -UserAgent "Mozilla/5.0" -ErrorAction SilentlyContinue
# Separator for better readability
Write-Host "----- BEGIN HEADER DEBUG -----"
# Current Timestamp
Write-Host ("Timestamp: " + (Get-Date))
# Iterate through all header keys
$response.Headers.Keys | ForEach-Object {
$key = $_
$value = $response.Headers[$_]
# Type information
$type = $value.GetType().FullName
Write-Host ("Key: $key, Type: $type")
# If value is array, iterate through it
if ($value -is [System.Array]) {
$value | ForEach-Object { Write-Host (" Value: $_") }
} else {
Write-Host (" Value: $value")
}
}
# Separator for better readability
Write-Host "----- END HEADER DEBUG -----"
$contentType = $response.Headers['Content-Type'].Trim()
Write-Host "Debug: Content-Type: $contentType"
if ($response -eq $null) {
throw "Failed to receive a valid response from the server."
}
Expand All @@ -32,7 +60,7 @@ jobs:
throw "Received unexpected Content-Type $($response.ContentType)"
}
if ($response.BaseResponse.ResponseUri -eq $null) {
Write-Host "Debug: Response Headers: $($response.Headers)"
Write-Host "Debug: Full Response Object: $($response | Out-String)"
throw "No ResponseUri in the HTTP response."
}
$version = $response.BaseResponse.ResponseUri.Segments[-1].Replace('FontLab-8-Win64-Install-', '').Replace('.exe', '')
Expand Down

0 comments on commit 88a5617

Please sign in to comment.