Skip to content

ci: add 'Release PR Changelog' GitHub action #22

ci: add 'Release PR Changelog' GitHub action

ci: add 'Release PR Changelog' GitHub action #22

name: Release Changelog
on:
pull_request:
branches:
- master
types: [opened, synchronize]
jobs:
release-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.ref }}
- name: Generate changelog
id: generate_changelog
run: |
npm install -g conventional-changelog-cli
conventional-changelog -p angular -i CHANGELOG.md -s -r 0
cat CHANGELOG.md > changelog.txt
echo "CHANGELOG_CONTENT=$(cat changelog.txt)" >> $GITHUB_ENV
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v1
with:
message: |
## Changelog
${{ env.CHANGELOG_CONTENT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}