Skip to content

Update Changelog

Update Changelog #1

name: Update Changelog
on:
release:
types: [published]
jobs:
update-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Fetch Version Tag & Release Notes
id: get_release_info
run: |
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
echo "NOTES<<EOF" >> $GITHUB_ENV
gh release view ${{ github.event.release.tag_name }} --json body -q .body >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Insert Version Tag & Release Notes Below `# Changelog`
run: |
{ echo "# Changelog"; echo; echo "## $VERSION"; echo; echo "$NOTES"; echo; tail -n +2 CHANGELOG.md; } > temp.md && mv temp.md CHANGELOG.md
- name: Create Pull Request to push updated CHANGELOG.md
uses: peter-evans/create-pull-request@v7
with:
#token: ${{ secrets.ACTION_SECRET }}
commit-message: update CHANGELOG
title: Update changelog with latest release notes
body: Update CHANGELOG.md to reflect release changes
branch: update-changelog
labels: |
automated-pr
delete-branch: true
base: main