GitHub Action
Update Changelog
0.0.1
Pre-release
This Action keeps your CHANGELOG.md up to date.
- Create
CHANGELOG.md
file using keep a changelog format - Use the example workflow to create a PR for eash release automatically.
- Use
Keep a changelog
style in your PR notes to automatically include these entries toCHANGELOG.md
on release
on:
release:
type: published
jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: Update version
id: version
run: |
echo "GITHUB_REF is a tag you set for the release"
echo "Your GitHub ref: ${GITHUB_REF}"
VERSION=`echo "${GITHUB_REF}" | cut -f 3 -d "/"`
echo "Preparing version ${VERSION}"
echo "__version__ = \"${VERSION}\"" > __version__.py
echo "##[set-output name=version;]$(echo ${VERSION})"
- uses: vemel/[email protected]
id: changelog
with:
version: ${{ steps.version.outputs.version }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
with:
commit-message: Release ${{ steps.version.outputs.version }}
labels: release, bot
title: "Release ${{ steps.version.outputs.version }}"
body: |
# Release ${{ steps.version.outputs.version }}
Merge this PR to update your version and changelog!
## Included Pull Requests
${{ steps.changelog.outputs.pulls_list_md }}
version
- New product version, defaults to envVERSION
token
- GitHub Token, defaults to envGITHUB_TOKEN
repository
- GitHub repository name, defaults to envGITHUB_REPOSITORY
path
- Path to theCHANGELOG.md
file, defaults to./CHANGELOG.md
release-marker
- Case-insensitive release marker in PR title, defaults torelease
pulls_list_md
- Generated included Pull Requests list in MarkDown format
create_release
version follows Semantic Versioning.