Skip to content

Commit 54c1208

Browse files
committed
Add license header check during CI
1 parent 6ade3e7 commit 54c1208

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/prs_and_commits.yml

+9
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ jobs:
4949
distribution: 'adopt'
5050
java-version: 8
5151
cache: maven
52+
- name: License header check
53+
run: |
54+
mvn license:remove license:format
55+
if [[ -n $(git status -s) ]]; then
56+
echo 1>&2 'Some files do not have the correct license header:'
57+
git diff --name-only 1>&2
58+
echo 1>&2 'Please update the license headers for these files by running `mvn license:remove license:format`'
59+
exit 1
60+
fi
5261
- name: Build (Maven)
5362
run: mvn -P ci --batch-mode clean package -DskipTests
5463
- name: Unit tests (Maven)

0 commit comments

Comments
 (0)