Update test.yml

This commit is contained in:
Dmitry Nefedov
2022-09-06 20:21:37 +03:00
committed by GitHub
parent 575da01fee
commit d3fcbc7c33

View File

@@ -16,16 +16,15 @@ jobs:
- name: test.md - name: test.md
id: read_release id: read_release
run: | run: |
# https://en.wikipedia.org/wiki/Percent-encoding
$Release = (Get-Content -Path test.md -Encoding utf8 -Raw).replace("`n", "%0A").replace("`r", "%0D")
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/Sophia-Community/SophiApp/releases" Uri = "https://api.github.com/repos/Sophia-Community/SophiApp/releases"
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }
$Penultimate = (Invoke-RestMethod @Parameters).tag_name | Select-Object -Index 1 $Penultimate = (Invoke-RestMethod @Parameters).tag_name | Select-Object -Index 1
$Release.replace("NewVersion", "${{ github.ref }}").replace("ReleaseDate", "$((Get-Date).ToShortDateString())").replace("OldVersion", "$($Penultimate)")
# https://en.wikipedia.org/wiki/Percent-encoding
$Release = (Get-Content -Path test.md -Encoding utf8 -Raw).replace("`n", "%0A").replace("`r", "%0D").replace("NewVersion", "${{ github.ref }}").replace("ReleaseDate", "$((Get-Date).ToShortDateString())").replace("OldVersion", "$($Penultimate)")
# https://trstringer.com/github-actions-multiline-strings/ # https://trstringer.com/github-actions-multiline-strings/
echo "::set-output name=RELEASE_BODY::$Release" echo "::set-output name=RELEASE_BODY::$Release"