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
|
- master
|
||||||
|
|
||||||
env:
|
env:
|
||||||
EXTENSIONS: "c h cpp py go sh"
|
EXTENSIONS: "c h cpp py go sh mk spec service"
|
||||||
|
FILES: "*Makefile"
|
||||||
jobs:
|
jobs:
|
||||||
verify-date:
|
verify-date:
|
||||||
runs-on: ubuntu-latest
|
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.added_files }})
|
||||||
files_to_check+=(${{ steps.changed-files.outputs.modified_files }})
|
files_to_check+=(${{ steps.changed-files.outputs.modified_files }})
|
||||||
|
|
||||||
for FILE in ${files_to_check[@]}; do
|
for file in ${files_to_check[@]}; do
|
||||||
REGEX=".*\.(.*)"
|
for file_in_list in $FILES; do
|
||||||
if [[ "$FILE" =~ $REGEX ]]
|
if [[ "$file" == $file_in_list ]]; then
|
||||||
then
|
.github/verify_header.sh "$file"
|
||||||
EXTENSION=${BASH_REMATCH[1]}
|
continue 2
|
||||||
EXTENSIONS_LIST=($EXTENSIONS)
|
fi
|
||||||
if [[ " ${EXTENSIONS_LIST[*]} " =~ " ${EXTENSION} " ]]
|
done
|
||||||
then
|
|
||||||
.github/verify_header.sh $FILE
|
extension=${file##*.}
|
||||||
fi
|
if [[ "$EXTENSIONS" =~ $extension ]]; then
|
||||||
|
.github/verify_header.sh "$file"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user