File tree Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Expand file tree Collapse file tree 3 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 13
13
steps :
14
14
- name : Checkout
15
15
uses : actions/checkout@v4
16
+ with :
17
+ ref : ${{ github.event.pull_request.head.sha }}
18
+ # No shallow clone, we want to be able to compare PR branch
19
+ # to main.
20
+ fetch-depth : 0
16
21
- name : Run linters
17
22
env :
18
23
VERSION : ${{ matrix.emacs_version }}
19
24
run : >-
20
- make docker CMD="make lint"
25
+ make docker CMD="make lint lint-changelog "
Original file line number Diff line number Diff line change @@ -107,3 +107,7 @@ fmt-changed: ## Get list of changed formatters on this PR
107
107
.PHONY : fmt-test # env var: FORMATTERS
108
108
fmt-test : # # Actually run formatter tests
109
109
@test/formatters/run-func.bash apheleia-ft-test
110
+
111
+ .PHONY : lint-changelog
112
+ lint-changelog : # # Report an error if the changelog wasn't updated
113
+ @scripts/lint-changelog.bash
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ changed_files=" $( git diff --name-only origin/main) "
6
+ if [[ -z " ${changed_files} " ]]; then
7
+ exit 0
8
+ fi
9
+
10
+ commit_messages=" $( git log origin/main..) "
11
+ if tr ' [:upper:]' ' [:lower:]' <<< " ${commit_messages}" | \
12
+ tr ' \n' ' ' | sed -E ' s/[[:space:]]+/ /g' | \
13
+ grep -q " no changelog update needed" ; then
14
+ exit 0
15
+ fi
16
+
17
+ if ! grep -qF CHANGELOG.md <<< " ${changed_files}" ; then
18
+ cat << "EOF "
19
+ <== lint-changelog ==>
20
+
21
+ Please update the changelog to cover the changes you made. Or, if the
22
+ changes don't need to be documented in the changelog, add the text "no
23
+ changelog update needed" to one of your commit messages. Line breaks
24
+ and case sensitivity do not matter.
25
+
26
+ Remember, when writing a changelog entry, the idea is a user can use
27
+ it to understand what differences they might notice after upgrading to
28
+ the new version. So, include enough context for someone who isn't
29
+ working directly on the code to understand. If user-visible behavior
30
+ hasn't changed since the last release, for example because you're
31
+ fixing a bug that was just introduced, then you don't need a changelog
32
+ entry.
33
+
34
+ <== lint-changelog ==>
35
+
36
+ lint-changelog: Please update the changelog to cover the changes you made.
37
+ EOF
38
+ exit 1
39
+ fi
You can’t perform that action at this time.
0 commit comments