diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index ab4628a..a114262 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -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