Skip to content

Commit 6aa8cf2

Browse files
committed
allow projects to use a custom license header template
1 parent 6d92204 commit 6aa8cf2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/scripts/check-license-header.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ fatal() { error "$@"; exit 1; }
1919

2020
test -n "${PROJECT_NAME:-}" || fatal "PROJECT_NAME unset"
2121

22-
expected_file_header_template="@@===----------------------------------------------------------------------===@@
22+
if [ -f .license_header_template ]; then
23+
# allow projects to override the license header template
24+
expected_file_header_template=$(cat .license_header_template)
25+
else
26+
expected_file_header_template="@@===----------------------------------------------------------------------===@@
2327
@@
2428
@@ This source file is part of the ${PROJECT_NAME} open source project
2529
@@
@@ -32,6 +36,7 @@ expected_file_header_template="@@===--------------------------------------------
3236
@@ SPDX-License-Identifier: Apache-2.0
3337
@@
3438
@@===----------------------------------------------------------------------===@@"
39+
fi
3540

3641
paths_with_missing_license=( )
3742

0 commit comments

Comments
 (0)