copyright/license: Improve checking for copyright header
Besides looking for files with proper extension, check also listed files without extension, which should contain this header as well. Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
This commit is contained in:
parent
9d7f4becb8
commit
46229dceed
24
.github/workflows/pullrequest.yml
vendored
24
.github/workflows/pullrequest.yml
vendored
@ -5,7 +5,8 @@ on:
|
||||
- master
|
||||
|
||||
env:
|
||||
EXTENSIONS: "c h cpp py go sh"
|
||||
EXTENSIONS: "c h cpp py go sh mk spec service"
|
||||
FILES: "*Makefile"
|
||||
jobs:
|
||||
verify-date:
|
||||
runs-on: ubuntu-latest
|
||||
@ -23,15 +24,16 @@ jobs:
|
||||
files_to_check=(${{ steps.changed-files.outputs.added_files }})
|
||||
files_to_check+=(${{ steps.changed-files.outputs.modified_files }})
|
||||
|
||||
for FILE in ${files_to_check[@]}; do
|
||||
REGEX=".*\.(.*)"
|
||||
if [[ "$FILE" =~ $REGEX ]]
|
||||
then
|
||||
EXTENSION=${BASH_REMATCH[1]}
|
||||
EXTENSIONS_LIST=($EXTENSIONS)
|
||||
if [[ " ${EXTENSIONS_LIST[*]} " =~ " ${EXTENSION} " ]]
|
||||
then
|
||||
.github/verify_header.sh $FILE
|
||||
fi
|
||||
for file in ${files_to_check[@]}; do
|
||||
for file_in_list in $FILES; do
|
||||
if [[ "$file" == $file_in_list ]]; then
|
||||
.github/verify_header.sh "$file"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
|
||||
extension=${file##*.}
|
||||
if [[ "$EXTENSIONS" =~ $extension ]]; then
|
||||
.github/verify_header.sh "$file"
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user