chore: get release notes from the tag's message body

This commit is contained in:
Emmanuel BENOîT 2024-07-19 18:19:02 +02:00
parent 11f29bba5e
commit 4d8f84669d
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg

View file

@ -18,6 +18,16 @@ jobs:
id: go-version
run: |
sed '/^go /!d; s/go /version=/' go.mod >>"$GITHUB_OUTPUT"
-
name: Extract release notes
id: release-notes
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
TAG_DATA="$(git tag -l --format '%(contents:body)' "${GITHUB_REF#refs/tags/}")"
TAG_DATA="${TAG_DATA//'%'/'%25'}"
TAG_DATA="${TAG_DATA//$'\n'/'%0A'}"
TAG_DATA="${TAG_DATA//$'\r'/'%0D'}"
echo "::set-output name=content::${TAG_DATA}"
-
name: Setup Go
uses: actions/setup-go@v5
@ -38,4 +48,5 @@ jobs:
direction: upload
name: binaries
release-dir: dist/release
release-notes: ${{ steps.release-notes.outputs.content }}
token: ${{ secrets.FORGEJO_TOKEN }}