@@ -224,13 +224,12 @@ LogGroup 'Calculate Job Run Conditions:' {
224224 $isMergedPR = $isPR -and $pullRequestAction -eq ' closed' -and $pullRequestIsMerged -eq $true
225225 $isNotAbandonedPR = -not $isAbandonedPR
226226
227- # Check if a prerelease label was added or exists on the PR
227+ # Check if a prerelease label exists on the PR
228228 $prereleaseLabels = $settings.Publish.Module.PrereleaseLabels -split ' ,' | ForEach-Object { $_.Trim () }
229229 $prLabels = @ ($pullRequest.labels.name )
230230 $hasPrereleaseLabel = ($prLabels | Where-Object { $prereleaseLabels -contains $_ }).Count -gt 0
231- $labelName = $eventData.Label.name
232- $isPrereleaseLabeled = $pullRequestAction -eq ' labeled' -and ($prereleaseLabels -contains $labelName )
233- $shouldPrerelease = $isPR -and (($isOpenOrUpdatedPR -and $hasPrereleaseLabel ) -or $isPrereleaseLabeled )
231+ $isOpenOrLabeledPR = $isPR -and $pullRequestAction -in @ (' opened' , ' reopened' , ' synchronize' , ' labeled' )
232+ $shouldPrerelease = $isOpenOrLabeledPR -and $hasPrereleaseLabel
234233
235234 # Determine ReleaseType - what type of release to create
236235 # Values: 'Release', 'Prerelease', 'None'
@@ -246,10 +245,12 @@ LogGroup 'Calculate Job Run Conditions:' {
246245 [pscustomobject ]@ {
247246 isPR = $isPR
248247 isOpenOrUpdatedPR = $isOpenOrUpdatedPR
248+ isOpenOrLabeledPR = $isOpenOrLabeledPR
249249 isAbandonedPR = $isAbandonedPR
250250 isMergedPR = $isMergedPR
251251 isNotAbandonedPR = $isNotAbandonedPR
252252 isTargetDefaultBranch = $isTargetDefaultBranch
253+ hasPrereleaseLabel = $hasPrereleaseLabel
253254 shouldPrerelease = $shouldPrerelease
254255 ReleaseType = $releaseType
255256 } | Format-List | Out-String
0 commit comments