Skip to content

Release

Release #32

Workflow file for this run

name: Release
on:
release:
types:
- created
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read changelog
id: read-changelog
run: |
echo 'content<<EOF' >> $GITHUB_OUTPUT
cat CHANGELOG.md >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Parse changelog
id: regex-match
run: |
regex='## \[${{ github.event.release.tag_name }}\].*\n\n((.|\n)+?)(?:## \[[0-9]+.[0-9]+.[0-9]+\])'
changelog=$(cat <<EOF
"${{ steps.read-changelog.outputs.content }}"
EOF
)
echo $regex
if [[ $changelog =~ $regex ]]
then
echo 'group1<<EOF' >> $GITHUB_OUTPUT
echo '${BASH_REMATCH[1]}' >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
fi
- run: echo '${{ steps.regex-match.outputs.group1 }}'
# uses: kaisugi/action-regex-match@v1.0.1
# id: regex-match
# with:
# text: ${{ steps.read-changelog.outputs.content }}
# regex: '## \[${{ github.event.release.tag_name }}\].*\n\n((.|\n)+?)(?:## \[[0-9]+.[0-9]+.[0-9]+\])'
# flags: gm
- name: Set release body
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.regex-match.outputs.group1 }}