From 54c1208a926b23bb5c240c7867103afdb8c7ac58 Mon Sep 17 00:00:00 2001 From: Chris Egerton Date: Thu, 14 Mar 2024 12:54:36 +0000 Subject: [PATCH] Add license header check during CI --- .github/workflows/prs_and_commits.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/prs_and_commits.yml b/.github/workflows/prs_and_commits.yml index 498905b..64eef81 100644 --- a/.github/workflows/prs_and_commits.yml +++ b/.github/workflows/prs_and_commits.yml @@ -49,6 +49,15 @@ jobs: distribution: 'adopt' java-version: 8 cache: maven + - name: License header check + run: | + mvn license:remove license:format + if [[ -n $(git status -s) ]]; then + echo 1>&2 'Some files do not have the correct license header:' + git diff --name-only 1>&2 + echo 1>&2 'Please update the license headers for these files by running `mvn license:remove license:format`' + exit 1 + fi - name: Build (Maven) run: mvn -P ci --batch-mode clean package -DskipTests - name: Unit tests (Maven)