Skip to content
name: Test release notes to delete before merge
on: push
jobs:
display-github-release-notes:
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Extract version from _version.py
id: get_version
run: |
version=$(python -c "exec(open('_version.py').read()); print(__version__)")
echo "VERSION=$version" >> $GITHUB_ENV
- name: Get release notes from CHANGELOG.md
run: |
version=${{ env.VERSION }}
# Adjusted awk to extract notes with custom section headings and emoji
notes=$(awk "/## \[$version\]/, /^## \[.*\]/ {if (/^## \[.*\]/) exit; print}" CHANGELOG.md)
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
echo "$notes" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Display release notes
run: echo "${{ env.RELEASE_NOTES }}"