Skip to content

Commit 5368c27

Browse files
authored
add changelog linter
1 parent 312b039 commit 5368c27

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/linters.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,32 @@ jobs:
143143
echo "CURRENT =${CURRENT}"
144144
echo "EXPECTED=${EXPECTED}"
145145
test "${CURRENT}" = "${EXPECTED}"
146+
147+
changelog:
148+
149+
name: Changelog
150+
runs-on: ubuntu-latest
151+
timeout-minutes: 5
152+
153+
if: >-
154+
github.event_name == 'pull_request' &&
155+
!contains(github.event.head_commit.message, 'nochangelog') &&
156+
!contains(github.event.head_commit.message, 'no-changelog') &&
157+
!contains(github.event.head_commit.message, 'no changelog') &&
158+
!contains(github.event.pull_request.labels.*.name, 'no-changelog')
159+
160+
steps:
161+
- name: Checkout
162+
uses: actions/checkout@v4
163+
with:
164+
fetch-depth: 0
165+
166+
- name: Check for CHANGELOG entry
167+
env:
168+
TARGET: ${{ github.event.pull_request.base.ref }}
169+
run: |
170+
FILES_CHANGED=$(git diff --name-only origin/$TARGET...HEAD | grep -E 'CHANGELOG\.md' -c)
171+
if [ "$FILES_CHANGED" != "1" ]; then
172+
echo "CHANGELOG.md was not updated";
173+
exit 1;
174+
fi;

0 commit comments

Comments
 (0)