Skip to content

Commit f6afe9d

Browse files
committed
Add dry run param to allow testing workflow without submitting PR
Signed-off-by: Guillaume Tardif <guillaume.tardif@gmail.com>
1 parent a39c6a3 commit f6afe9d

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

‎.github/workflows/winget.yml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ on:
88
description: "Release tag to publish (e.g., v1.20.5)"
99
required: true
1010
type: string
11+
dry_run:
12+
description: "Dry run (do not submit PR)"
13+
required: false
14+
type: boolean
15+
default: false
1116

1217
env:
1318
WINGET_CREATE_GITHUB_TOKEN: ${{ secrets.WINGET_GH_TOKEN }}
@@ -21,6 +26,7 @@ jobs:
2126
- name: publish
2227
env:
2328
VERSION: ${{ inputs.release_tag || github.event.release.tag_name }}
29+
DRY_RUN: ${{ inputs.dry_run || false }}
2430
run: |
2531
curl.exe -JLO https://aka.ms/wingetcreate/latest
2632
if ($LASTEXITCODE -ne 0) {
@@ -39,9 +45,17 @@ jobs:
3945
}
4046
4147
$Version = $ENV:VERSION
48+
$DryRun = $ENV:DRY_RUN -eq 'true'
4249
$PackageId = "Docker.Cagent"
4350
$Urls = @(
4451
"https://github.com/docker/cagent/releases/download/$Version/cagent-windows-amd64.exe|amd64",
4552
"https://github.com/docker/cagent/releases/download/$Version/cagent-windows-arm64.exe|arm64"
4653
)
47-
& .\wingetcreate.exe update $PackageId -s -v $Version -u $Urls
54+
55+
# Build command with conditional -s flag
56+
$params = @('update', $PackageId, '-v', $Version, '-u', $Urls)
57+
if (-not $DryRun) {
58+
$params += '-s'
59+
}
60+
61+
& .\wingetcreate.exe @params

0 commit comments

Comments
 (0)