-
Notifications
You must be signed in to change notification settings - Fork 1
34 lines (28 loc) · 1.06 KB
/
changelog-check.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Check CHANGELOG
on:
pull_request:
branches:
- main
jobs:
check-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: git fetch --depth=1 origin ${{ github.event.pull_request.base.name }}
- name: Setup Python ${{ env.PYTHON_VERSION }} environment
uses: ./.github/actions/setup-python-env
- name: Check for new changie entry
run: |
CHANGES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep -E "\.changes/.*\.md")
if [ "$CHANGES" == "" ]; then
echo "No files added to `.changes/`. Make sure you run `changie new`."
exit 1
fi
- name: Assert CHANGELOG and package versions are the same
run:
CHANGELOG_VERSION=$(changie latest | cut -c 2-)
PACKAGE_VERSION=$(hatch version)
if [ "$CHANGELOG_VERSION" != "$PACKAGE_VERSION" ]; then
echo "Changelog has version '$CHANGELOG_VERSION' while package has '$PACKAGE_VERSION'."
exit 1
fi