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 changelog check to github workflows #1625

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
33 changes: 33 additions & 0 deletions .github/workflows/changelog-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Check Changelog

on:
pull_request:
types: [opened, synchronize, reopened]

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

steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true

- name: Check if changelog exists in PR
id: check_for_changelog
run: |
git fetch origin ${{ github.base_ref }} --depth=1
if git diff --name-only origin/${{ github.base_ref }} | grep -q 'CHANGELOG.md'; then
echo "Changelog file found."
echo "changelog_exists=true" >> $GITHUB_ENV
else
echo "Changelog file not found."
echo "changelog_exists=false" >> $GITHUB_ENV
fi

- name: Fail if no changelog
if: env.changelog_exists == 'false'
run: |
echo "Error: No CHANGELOG.md file found in this Pull Request."
exit 1
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ your changes, such as:
- [public] [both] [updated] add a new feature

## [Unreleased]

- [public] [both] [updated] add chenge log check to github ci
Loading