Skip to content

Commit 0cf689b

Browse files
Only create Release when PR merges to default branch
1 parent c017ec9 commit 0cf689b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/main.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,13 @@ LogGroup 'Calculate Job Run Conditions:' {
280280

281281
# Determine ReleaseType - single source of truth for what Publish-PSModule should do
282282
# Values: 'Release', 'Prerelease', 'Cleanup', 'None'
283+
# Release only happens when PR is merged into the default branch
283284
$releaseType = if (-not $isPR) {
284285
'None'
285-
} elseif ($isMergedPR) {
286+
} elseif ($isMergedPR -and $isTargetDefaultBranch) {
286287
'Release'
288+
} elseif ($isMergedPR -and -not $isTargetDefaultBranch) {
289+
'None' # Merged to non-default branch - no release
287290
} elseif ($isAbandonedPR) {
288291
'Cleanup'
289292
} elseif ($shouldPrerelease) {

0 commit comments

Comments
 (0)