From 6aa8cf2bdca71d9600431979392c2c2496f3075e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Stormacq?= Date: Thu, 17 Oct 2024 12:25:34 +0200 Subject: [PATCH] allow projects to use a custom license header template --- .github/workflows/scripts/check-license-header.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/scripts/check-license-header.sh b/.github/workflows/scripts/check-license-header.sh index d280e87..9a16464 100755 --- a/.github/workflows/scripts/check-license-header.sh +++ b/.github/workflows/scripts/check-license-header.sh @@ -19,7 +19,11 @@ fatal() { error "$@"; exit 1; } test -n "${PROJECT_NAME:-}" || fatal "PROJECT_NAME unset" -expected_file_header_template="@@===----------------------------------------------------------------------===@@ +if [ -f .license_header_template ]; then + # allow projects to override the license header template + expected_file_header_template=$(cat .license_header_template) +else + expected_file_header_template="@@===----------------------------------------------------------------------===@@ @@ @@ This source file is part of the ${PROJECT_NAME} open source project @@ @@ -32,6 +36,7 @@ expected_file_header_template="@@===-------------------------------------------- @@ SPDX-License-Identifier: Apache-2.0 @@ @@===----------------------------------------------------------------------===@@" +fi paths_with_missing_license=( )