fix: cleanup markdown modification script in release GHA (#4357)

This commit is contained in:
Nico Domino 2024-07-13 14:23:00 +02:00 committed by GitHub
parent b91d54623d
commit d5497592ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,8 @@ jobs:
run: cd docs && pnpm install
- name: Add content
run: |
NEW_CONTENT=$(cat <<- END
VERSION=$(echo ${{ github.event.release.tag_name }} | sed "s|^.*/||" )
NEW_RELEASE_BODY=$(cat <<- END
{/* NEW_RELEASE */}
${{ github.event.release.body }}
@ -31,7 +32,11 @@ jobs:
END
)
sed -i "s|{/* NEW_RELEASE */}|${NEW_CONTENT}|"
ESCAPED_DATA="$(echo "${NEW_RELEASE_BODY}" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/\$/\\$/g' | sed 's|<|\\\\<|g')"
NEW_CONTENT="$(echo "${ESCAPED_DATA}" | sed "s|## What's Changed|## ${VERSION}|")"
sed -i "s|{/\* NEW_RELEASE \*/}|${NEW_CONTENT}|"
- name: Push changes
run: |
cd docs