Skip to content

Commit a39c6a3

Browse files
committed
copilot recommendations
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
1 parent 83ed34a commit a39c6a3

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

‎.github/workflows/winget.yml‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
workflow_dispatch:
66
inputs:
77
release_tag:
8-
description: 'Release tag to publish (e.g., v1.20.5)'
8+
description: "Release tag to publish (e.g., v1.20.5)"
99
required: true
1010
type: string
1111

@@ -22,11 +22,26 @@ jobs:
2222
env:
2323
VERSION: ${{ inputs.release_tag || github.event.release.tag_name }}
2424
run: |
25+
curl.exe -JLO https://aka.ms/wingetcreate/latest
26+
if ($LASTEXITCODE -ne 0) {
27+
Write-Error "Failed to download wingetcreate.exe (curl exit code: $LASTEXITCODE)"
28+
exit 1
29+
}
30+
if (-not (Test-Path .\wingetcreate.exe)) {
31+
Write-Error "wingetcreate.exe was not downloaded successfully"
32+
exit 1
33+
}
34+
# Verify the signature
35+
$sig = Get-AuthenticodeSignature .\wingetcreate.exe
36+
if ($sig.Status -ne 'Valid') {
37+
Write-Error "Invalid signature on wingetcreate.exe: $($sig.Status)"
38+
exit 1
39+
}
40+
2541
$Version = $ENV:VERSION
2642
$PackageId = "Docker.Cagent"
2743
$Urls = @(
2844
"https://github.com/docker/cagent/releases/download/$Version/cagent-windows-amd64.exe|amd64",
2945
"https://github.com/docker/cagent/releases/download/$Version/cagent-windows-arm64.exe|arm64"
3046
)
31-
& curl.exe -JLO https://aka.ms/wingetcreate/latest
3247
& .\wingetcreate.exe update $PackageId -s -v $Version -u $Urls

0 commit comments

Comments
 (0)