diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index a34c554..685197b 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -3,9 +3,10 @@ on: pull_request: branches: - master - + env: - EXTENSIONS: "c h cpp py go sh" + EXTENSIONS: "c h cpp py go sh mk spec service" + FILES: "configure configure.d/* *Makefile utils/casctl tools/pckgen.d/deb/debian/rules" 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