Skip to content

Commit bdb9b18

Browse files
committed
fix: clean up logging and return values in changelog scripts
1 parent 8c96115 commit bdb9b18

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

updater/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,7 @@ runs:
169169
-RepoUrl '${{ steps.target.outputs.url }}' `
170170
-OldTag '${{ steps.target.outputs.originalTag }}' `
171171
-NewTag '${{ steps.target.outputs.latestTag }}'
172-
Write-host "Prev call result: $? | LASTEXITCODE = $LASTEXITCODE"
173-
Write-Host "Changelog length: $("$changelog".Length) characters"
174-
Set-PSDebug -Strict -Trace 2
175172
${{ github.action_path }}/scripts/set-github-env.ps1 TARGET_CHANGELOG $changelog
176-
Write-host "Prev call result: $? | LASTEXITCODE = $LASTEXITCODE"
177173
178174
# First we create a PR only if it doesn't exist. We will later overwrite the content with the same action.
179175
- name: Create a PR

updater/scripts/get-changelog.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ try {
7979

8080
# The first lines are diff metadata, skip them
8181
$fullDiff = $fullDiff -split "`n" | Select-Object -Skip 4
82-
8382
if ([string]::IsNullOrEmpty($fullDiff)) {
8483
Write-Host "No differences found between $OldTag and $NewTag"
8584
return
@@ -133,12 +132,11 @@ try {
133132
}
134133

135134
Write-Host "Final changelog length: $($changelog.Length) characters"
136-
return $changelog
135+
Write-Output $changelog
137136
}
138137
}
139138

140139
Write-Host "No changelog additions found between $OldTag and $NewTag"
141-
return ''
142140
} catch {
143141
Write-Warning "Failed to get changelog: $($_.Exception.Message)"
144142
} finally {
@@ -148,3 +146,7 @@ try {
148146
Write-Host 'Cleanup complete.'
149147
}
150148
}
149+
150+
# This resets the $LASTEXITCODE set by git diff above.
151+
# Note that this only runs in the successful path.
152+
exit 0

0 commit comments

Comments
 (0)