File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ script_path=$( dirname $( realpath $0 ) ) /../
3
+
4
+ function add_license () {
5
+ (find " $script_path " -name $1 | grep -v " /bin/" | grep -v " /obj/" )| while read fname; do
6
+ line=$( sed -n ' 2p;3q' " $fname " )
7
+ if ! [[ " $line " == " * Licensed to Elasticsearch B.V. under one or more contributor" ]] ; then
8
+ cat " ${script_path} .github/license-header.txt" " $fname " > " ${fname} .new"
9
+ mv " ${fname} .new" " $fname "
10
+ fi
11
+ done
12
+ }
13
+
14
+ add_license " *.cs"
Original file line number Diff line number Diff line change
1
+ name : License headers
2
+
3
+ on : [ pull_request ]
4
+
5
+ permissions :
6
+ contents : read
7
+
8
+ jobs :
9
+ build :
10
+
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - uses : actions/checkout@v4
15
+
16
+ - name : Check license headers
17
+ run : |
18
+ ./.github/check-license-headers.sh
You can’t perform that action at this time.
0 commit comments