Skip to content

Commit 152eb8f

Browse files
🩹 [Patch]: Rename CleanupPrereleases to AutoCleanup and update related logic in settings
1 parent f73e0bc commit 152eb8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎scripts/main.ps1‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ $settings = [pscustomobject]@{
163163
Publish = [pscustomobject]@{
164164
Module = [pscustomobject]@{
165165
Skip = $settings.Publish.Module.Skip ?? $false
166-
CleanupPrereleases = $settings.Publish.Module.CleanupPrereleases ?? $true
166+
AutoCleanup = $settings.Publish.Module.AutoCleanup ?? $true
167167
AutoPatching = $settings.Publish.Module.AutoPatching ?? $true
168168
IncrementalPrerelease = $settings.Publish.Module.IncrementalPrerelease ?? $true
169169
DatePrereleaseFormat = $settings.Publish.Module.DatePrereleaseFormat ?? ''
@@ -234,7 +234,7 @@ LogGroup 'Calculate Job Run Conditions:' {
234234

235235
# Determine ReleaseType - what type of release to create
236236
# Values: 'Release', 'Prerelease', 'None'
237-
# Note: Cleanup is a separate decision handled by CleanupPrereleases
237+
# Note: Cleanup is a separate decision handled by AutoCleanup
238238
$releaseType = if ($isMergedPR -and $isTargetDefaultBranch) {
239239
'Release'
240240
} elseif ($shouldPrerelease) {
@@ -426,12 +426,12 @@ if ($settings.Test.Skip) {
426426
# Calculate job-specific conditions and add to settings
427427
LogGroup 'Calculate Job Run Conditions:' {
428428
# Calculate if prereleases should be cleaned up:
429-
# True if (Release or Abandoned PR) AND user has CleanupPrereleases enabled (defaults to true)
430-
$shouldCleanupPrereleases = (($releaseType -eq 'Release') -or $isAbandonedPR) -and ($settings.Publish.Module.CleanupPrereleases -eq $true)
429+
# True if (Release or Abandoned PR) AND user has AutoCleanup enabled (defaults to true)
430+
$shouldAutoCleanup = (($releaseType -eq 'Release') -or $isAbandonedPR) -and ($settings.Publish.Module.AutoCleanup -eq $true)
431431

432432
# Update Publish.Module with computed release values
433433
$settings.Publish.Module | Add-Member -MemberType NoteProperty -Name ReleaseType -Value $releaseType -Force
434-
$settings.Publish.Module.CleanupPrereleases = $shouldCleanupPrereleases
434+
$settings.Publish.Module.AutoCleanup = $shouldAutoCleanup
435435

436436
# Create Run object with all job-specific conditions
437437
$run = [pscustomobject]@{
@@ -449,7 +449,7 @@ LogGroup 'Calculate Job Run Conditions:' {
449449
GetCodeCoverage = $isNotAbandonedPR -and (-not $settings.Test.CodeCoverage.Skip) -and (
450450
($null -ne $settings.TestSuites.PSModule) -or ($null -ne $settings.TestSuites.Module)
451451
)
452-
PublishModule = ($releaseType -ne 'None') -or $shouldCleanupPrereleases
452+
PublishModule = ($releaseType -ne 'None') -or $shouldAutoCleanup
453453
BuildDocs = $isNotAbandonedPR -and (-not $settings.Build.Docs.Skip)
454454
BuildSite = $isNotAbandonedPR -and (-not $settings.Build.Site.Skip)
455455
PublishSite = $isMergedPR -and $isTargetDefaultBranch

0 commit comments

Comments
 (0)