Skip to content

Commit 6b08d73

Browse files
Allow site builds without publication
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 2da7774 commit 6b08d73

5 files changed

Lines changed: 24 additions & 9 deletions

File tree

.github/actions/Get-PSModuleSettings/src/Settings.schema.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,16 @@
196196
"description": "The type of release to create: Release (stable), Prerelease, or None."
197197
}
198198
}
199+
},
200+
"Site": {
201+
"type": "object",
202+
"description": "Documentation site publish configuration",
203+
"properties": {
204+
"Skip": {
205+
"type": "boolean",
206+
"description": "Skip publishing the generated documentation site"
207+
}
208+
}
199209
}
200210
}
201211
},

.github/actions/Get-PSModuleSettings/src/main.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ $settings = [pscustomobject]@{
203203
UsePRBodyAsReleaseNotes = $settings.Publish.Module.UsePRBodyAsReleaseNotes ?? $true
204204
UsePRTitleAsNotesHeading = $settings.Publish.Module.UsePRTitleAsNotesHeading ?? $true
205205
}
206+
Site = [pscustomobject]@{
207+
Skip = $settings.Publish.Site.Skip ?? $false
208+
}
206209
}
207210
Linter = [pscustomobject]@{
208211
Skip = $settings.Linter.Skip ?? $false
@@ -688,10 +691,10 @@ LogGroup 'Calculate Job Run Conditions:' {
688691

689692
$settings.Publish.Module | Add-Member -MemberType NoteProperty -Name Desired -Value (($releaseType -ne 'None') -or $shouldAutoCleanup) -Force
690693
$settings.Publish.Module | Add-Member -MemberType NoteProperty -Name Enabled -Value (($releaseType -ne 'None') -or $shouldAutoCleanup) -Force
691-
$settings.Publish | Add-Member -MemberType NoteProperty -Name Site -Value ([pscustomobject]@{
692-
Desired = $releaseType -eq 'Release'
693-
Enabled = $releaseType -eq 'Release'
694-
}) -Force
694+
$settings.Publish.Site | Add-Member -MemberType NoteProperty -Name Desired -Value ($releaseType -eq 'Release') -Force
695+
$settings.Publish.Site | Add-Member -MemberType NoteProperty -Name Enabled -Value (
696+
$releaseType -eq 'Release' -and -not $settings.Publish.Site.Skip
697+
) -Force
695698

696699
$settings | Add-Member -MemberType NoteProperty -Name HasImportantChanges -Value $hasImportantChanges
697700

docs/content/reference/settings.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ For worked examples, see [Configuring the pipeline](../guides/configuring-the-pi
5858
| `Build.Docs.Skip` | `Boolean` | Skip documentation build | `false` |
5959
| `Build.Docs.ShowSummaryOnSuccess` | `Boolean` | Show super-linter summary on success for documentation linting | `false` |
6060
| `Build.Site.Skip` | `Boolean` | Skip site build | `false` |
61+
| `Publish.Site.Skip` | `Boolean` | Skip publishing the generated documentation site | `false` |
6162
| `Publish.Module.Skip` | `Boolean` | Skip module publishing | `false` |
6263
| `Publish.Module.AutoCleanup` | `Boolean` | Automatically clean up old prerelease tags when merging to main or when a PR is abandoned | `true` |
6364
| `Publish.Module.AutoPatching` | `Boolean` | Automatically patch module version | `true` |
@@ -137,6 +138,8 @@ Test:
137138
StepSummaryMode: 'Missed, Files'
138139

139140
Publish:
141+
Site:
142+
Skip: false
140143
Module:
141144
Skip: false
142145
AutoCleanup: true

tests/srcTestRepo/.github/PSModule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: PSModuleTest2
2-
Build:
2+
Publish:
33
Site:
44
Skip: true
55
Linter:

tests/srcWithManifestTestRepo/.github/PSModule.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
Name: PSModuleTest
2-
Build:
2+
Publish:
33
Site:
44
Skip: true
5+
Module:
6+
AutoCleanup: false
57
Test:
68
SourceCode:
79
Skip: true
@@ -12,9 +14,6 @@ Test:
1214
Skip: false
1315
CodeCoverage:
1416
PercentTarget: 1
15-
Publish:
16-
Module:
17-
AutoCleanup: false
1817
Linter:
1918
env:
2019
VALIDATE_BIOME_FORMAT: false

0 commit comments

Comments
 (0)