|
1 | | -[Diagnostics.CodeAnalysis.SuppressMessageAttribute( |
| 1 | +[Diagnostics.CodeAnalysis.SuppressMessageAttribute( |
2 | 2 | 'PSUseDeclaredVarsMoreThanAssignments', '', |
3 | 3 | Justification = 'Variables are assigned in BeforeAll and used inside It blocks.' |
4 | 4 | )] |
@@ -42,6 +42,10 @@ BeforeAll { |
42 | 42 | [Parameter()] |
43 | 43 | [switch] $CleanupOnly, |
44 | 44 |
|
| 45 | + # Whether module publication is disabled by repository settings. |
| 46 | + [Parameter()] |
| 47 | + [switch] $Skip, |
| 48 | + |
45 | 49 | # Labels indicating no release. |
46 | 50 | [Parameter()] |
47 | 51 | [string[]] $IgnoreLabels = @('release:skip'), |
@@ -70,6 +74,7 @@ BeforeAll { |
70 | 74 | VersionPrefix = $VersionPrefix |
71 | 75 | ReleaseType = $ReleaseType |
72 | 76 | IsCleanupOnly = $CleanupOnly.IsPresent |
| 77 | + Skip = $Skip.IsPresent |
73 | 78 | IgnoreLabels = $IgnoreLabels |
74 | 79 | MajorLabels = $MajorLabels |
75 | 80 | MinorLabels = $MinorLabels |
@@ -901,5 +906,16 @@ Describe 'Resolve-PSModuleVersion' { |
901 | 906 | { Resolve-ReleaseDecision -Configuration $configuration -PullRequest $pullRequest } | |
902 | 907 | Should -Throw '*ignore*prerelease*' |
903 | 908 | } |
| 909 | + |
| 910 | + It 'keeps a configured preview bump without publishing when module Skip is enabled' { |
| 911 | + $configuration = Get-TestConfiguration -DefaultBump minor -Skip |
| 912 | + $pullRequest = [pscustomobject]@{ HeadRef = 'feature'; Labels = @() } |
| 913 | + |
| 914 | + $decision = Resolve-ReleaseDecision -Configuration $configuration -PullRequest $pullRequest |
| 915 | + |
| 916 | + $decision.MinorRelease | Should -BeTrue |
| 917 | + $decision.ShouldPublish | Should -BeFalse |
| 918 | + $decision.CreateRelease | Should -BeFalse |
| 919 | + } |
904 | 920 | } |
905 | 921 | } |
0 commit comments