Skip to content

Commit ea0b754

Browse files
committed
Deploy: support workflow_dispatch for full republish
On workflow_dispatch, consider every module folder a publish candidate; the per-module Find-PSResource check still skips anything already on PSGallery. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent de32190 commit ea0b754

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

.github/workflows/Deploy.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,27 @@ jobs:
1717
with:
1818
fetch-depth: 2
1919

20-
- name: Discover Changed Modules
20+
- name: Discover Modules to Publish
2121
id: discover
2222
shell: pwsh
2323
run: |
24-
$changed = git diff --name-only HEAD~ HEAD
25-
$changed
26-
$modules = @()
27-
foreach ($file in $changed) {
28-
$parts = $file -split '/'
29-
if ($parts.Length -ge 2 -and $parts[0] -eq 'Modules') {
30-
$modules += $parts[1]
24+
if ('${{ github.event_name }}' -eq 'workflow_dispatch') {
25+
# Manual run: consider every module a candidate; the publish step
26+
# then skips any whose version is already on the gallery.
27+
$modules = Get-ChildItem -Path Modules -Directory | Select-Object -ExpandProperty Name
28+
} else {
29+
$changed = git diff --name-only HEAD~ HEAD
30+
$changed
31+
$modules = @()
32+
foreach ($file in $changed) {
33+
$parts = $file -split '/'
34+
if ($parts.Length -ge 2 -and $parts[0] -eq 'Modules') {
35+
$modules += $parts[1]
36+
}
3137
}
38+
$modules = $modules | Sort-Object -Unique
3239
}
33-
$modules = $modules | Sort-Object -Unique
34-
Write-Host "Changed modules: $($modules -join ', ')"
40+
Write-Host "Modules to consider: $($modules -join ', ')"
3541
"modules=$($modules -join ',')" >> $env:GITHUB_OUTPUT
3642
3743
- name: Install PSResourceGet

0 commit comments

Comments
 (0)