diff --git a/.github/workflows/release-cut.yml b/.github/workflows/release-cut.yml index 584b694cb87..9a950972787 100644 --- a/.github/workflows/release-cut.yml +++ b/.github/workflows/release-cut.yml @@ -736,7 +736,10 @@ jobs: } $latestYml = Get-Content -Path 'dist/latest.yml' -Raw - $latestYml = $latestYml -replace '(?m)^sha512: .+$', "sha512: $hash" + $latestYml = [regex]::Replace($latestYml, '(?m)^(\s*)sha512: .+$', { + param($match) + "$($match.Groups[1].Value)sha512: $hash" + }) $latestYml = $latestYml -replace '(?m)^ size: \d+$', " size: $($installer.Length)" $latestYml = $latestYml -replace '(?m)^ blockMapSize: \d+$', " blockMapSize: $($blockmap.Length)" Set-Content -Path 'dist/latest.yml' -Value $latestYml -NoNewline