Skip to content

Commit f9b9bc1

Browse files
authored
Refactor release notes logging in workflow
Updated the release notes generation process to use Heredoc syntax for storing multi-line strings in GITHUB_ENV.
1 parent a8a6a86 commit f9b9bc1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/dotnet-desktop.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,16 @@ jobs:
6868
}
6969
$logString = if ($log -is [Array]) { $log -join "`n" } else { $log }
7070
if ([string]::IsNullOrWhiteSpace($logString)) { $logString = git log -n 15 --pretty=format:"- %s (%h)" --no-merges -join "`n" }
71+
72+
# Create file for release notes
7173
$content = "## Changes in $env:NEW_TAG`n`n$logString"
7274
Set-Content -Path "release_notes.md" -Value $content -Encoding UTF8
73-
# Store raw log; PowerShell env will handle quotes automatically
74-
"ESCAPED_LOG=$logString" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
75+
76+
# Use Heredoc syntax to save multi-line string to GITHUB_ENV
77+
$eof = [System.Guid]::NewGuid().ToString("N")
78+
"ESCAPED_LOG<<$eof" | Out-File -FilePath $env:GITHUB_ENV -Append
79+
$logString | Out-File -FilePath $env:GITHUB_ENV -Append
80+
"$eof" | Out-File -FilePath $env:GITHUB_ENV -Append
7581
7682
# 4. CHECKOUT DEPENDENCIES
7783
- name: Checkout Dependencies

0 commit comments

Comments
 (0)