Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Check changelog" job #23

Merged
merged 2 commits into from
Dec 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/check-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# CHANGELOG.md is generated by https://github.com/github-changelog-generator/github-changelog-generator
# This job verifies, that it contains always the current content
name: Check Changelog

on:
push:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
check-changelog:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true

- name: Install github_changelog_generator
shell: bash
run: |
gem --user-install install github_changelog_generator

- name: Run github_changelog_generator
shell: bash
run: |
github_changelog_generator --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
exit 1
fi
id: diff

# If CHANGELOG.md was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: changelog
path: CHANGELOG.md