This GitHub action prepends the release note from the PR body to a changelog markdown file. It then commits and pushes the file.
version
: The version releasedbody
: The main text to add to the changelogpr-url
: URL to the PR that resulted in the releasechangelog-path
: Path to the CHANGELOG.md file. Defaults toCHANGELOG.md
in repo root.user-email
: The email of the user that should commit the CHANGELOGuser-name
: The name of the user that should commit the CHANGELOG
on:
pull_request:
types: [closed]
name: GitHub action workflow name
jobs:
context:
name: Job name
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# this outputs the PR body
- name: Establish context
id: context
uses: woksin-org/establish-context-action@v4
- name: Prepend to Changelog
if: ${{ steps.context.outputs.should-publish == 'true' }}
uses: woksin-org/add-to-changelog-action@v4
with:
version: ${{ steps.context.outputs.new-version }}
# input for the text to prepend to
body: ${{ steps.context.outputs.pr-body }}
pr-url: ${{ steps.context.outputs.pr-url }}
- name: Create GitHub Release
if: ${{ steps.context.outputs.should-publish == 'true' }}
uses: woksin-org/github-release-action@v3
with:
version: ${{ steps.context.outputs.new-version }}
body: ${{ steps.context.outputs.pr-body }}
token: ${{ secrets.BUILD_PAT }}
We're always open for contributions and bug fixes!
node <= 12 yarn git