Skip to content

Merge pull request #362 from adangel/sql-changelog-rollback #165

Merge pull request #362 from adangel/sql-changelog-rollback

Merge pull request #362 from adangel/sql-changelog-rollback #165

# CHANGELOG.md is generated by https://github.com/github-changelog-generator/github-changelog-generator
# It pushes the generated changelog automatically
name: Update Changelog
on:
push:
branches:
- main
workflow_dispatch:
# issues:
# types: [closed, labeled, unlabeled]
# pull_request:
# types: [closed, labeled, unlabeled]
jobs:
update-changelog:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run github_changelog_generator
shell: bash
run: |
bundle exec github_changelog_generator
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Compare the expected and actual CHANGELOG.md
run: |
if [ "$(git diff CHANGELOG.md | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
echo "changelog=outdated" >> $GITHUB_ENV
else
echo "changelog=current" >> $GITHUB_ENV
fi
id: diff
- name: Push changes to CHANGELOG.md
if: ${{ github.repository == 'liquibase/liquibase-percona' && env.changelog == 'outdated' }}
run: |
git config --local user.name "liquibot"
git config --local user.email "[email protected]"
git add CHANGELOG.md && git commit -m 'Updated CHANGELOG.md' && git push origin main