|
376 | 376 | $releaseCreateCommand += @('--title', $newVersion.ToString()) |
377 | 377 | } |
378 | 378 |
|
379 | | - # Add notes parameter - use temp file to avoid escaping issues with special characters |
| 379 | + # Build release notes content. Uses temp file to avoid escaping issues with special characters. |
| 380 | + # Precedence rules for the three UsePR* parameters: |
| 381 | + # 1. UsePRTitleAsNotesHeading + UsePRBodyAsReleaseNotes: Creates "# Title (#PR)\n\nBody" format. |
| 382 | + # Requires both parameters enabled AND both PR title and body to be present. |
| 383 | + # 2. UsePRBodyAsReleaseNotes only: Uses PR body as-is for release notes. |
| 384 | + # Takes effect when heading option is disabled/missing title, but body is available. |
| 385 | + # 3. Fallback: Auto-generates notes via GitHub's --generate-notes when no PR content is used. |
380 | 386 | if ($usePRTitleAsNotesHeading -and $usePRBodyAsReleaseNotes -and $pull_request.title -and $pull_request.body) { |
| 387 | + # Path 1: Full PR-based notes with title as H1 heading and PR number link |
381 | 388 | $prTitle = $pull_request.title |
382 | 389 | $prNumber = $pull_request.number |
383 | 390 | $prBody = $pull_request.body |
|
387 | 394 | $releaseCreateCommand += @('--notes-file', $notesFilePath) |
388 | 395 | Write-Output 'Using PR title as H1 heading with link and body as release notes' |
389 | 396 | } elseif ($usePRBodyAsReleaseNotes -and $pull_request.body) { |
| 397 | + # Path 2: PR body only - no heading, just the body content |
390 | 398 | $prBody = $pull_request.body |
391 | 399 | $notesFilePath = [System.IO.Path]::GetTempFileName() |
392 | 400 | Set-Content -Path $notesFilePath -Value $prBody -Encoding utf8 |
393 | 401 | $releaseCreateCommand += @('--notes-file', $notesFilePath) |
394 | 402 | Write-Output 'Using PR body as release notes' |
395 | 403 | } else { |
| 404 | + # Path 3: Fallback to GitHub's auto-generated release notes |
396 | 405 | $releaseCreateCommand += @('--generate-notes') |
397 | 406 | } |
398 | 407 |
|
|
0 commit comments