diff --git a/.github/workflows/ci_linting.yml b/.github/workflows/ci_linting.yml index 62ece4c3fd3..f98170a937b 100644 --- a/.github/workflows/ci_linting.yml +++ b/.github/workflows/ci_linting.yml @@ -35,7 +35,7 @@ jobs: - name: Check run: ./codebuild/bin/run_cppcheck.sh "$CPPCHECK_INSTALL_DIR" - copyright: + headers: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -44,7 +44,7 @@ jobs: run: source ./codebuild/bin/s2n_setup_env.sh - name: Check - run: ./codebuild/bin/copyright_mistake_scanner.sh + run: ./codebuild/bin/header_mistake_scanner.sh simple-mistakes: runs-on: ubuntu-latest diff --git a/codebuild/bin/copyright_mistake_scanner.sh b/codebuild/bin/header_mistake_scanner.sh similarity index 82% rename from codebuild/bin/copyright_mistake_scanner.sh rename to codebuild/bin/header_mistake_scanner.sh index 0d3e1b1688c..02e68104a68 100755 --- a/codebuild/bin/copyright_mistake_scanner.sh +++ b/codebuild/bin/header_mistake_scanner.sh @@ -35,6 +35,16 @@ for file in $S2N_FILES; do fi done +for file in $S2N_FILES; do + # The Apache 2.0 License should appear in every file + COUNT=`head -5 $file | grep -E "Apache License, Version 2.0|Apache-2.0" | wc -l`; + if [ "$COUNT" == "0" ]; + then + FAILED=1; + echo "License Check Failed: $file"; + fi +done + if [ $FAILED == 1 ]; then printf "\\033[31;1mFAILED Copyright Check\\033[0m\\n"