@@ -756,53 +756,6 @@ jobs:
756756
757757 # https://go.googlesource.com/vuln - govulncheck is same as BlackDuck SCA backend, redundant to add it here
758758
759- - name : Checkout repository for PL/pgSQL checks
760- if : inputs.language == 'plpgsql'
761- uses : actions/checkout@v6
762- with :
763- fetch-depth : 0
764- - name : PL/pgSQL language checks - ShellCheck
765- if : inputs.language == 'plpgsql'
766- run : |
767- echo "Running ShellCheck on shell scripts"
768- sudo apt-get update && sudo apt-get install -y shellcheck
769- find . -name '*.sh' -not -path './.git/*' -print0 | xargs -0 shellcheck --severity=warning || true
770- - name : PL/pgSQL language checks - SQL lint
771- if : inputs.language == 'plpgsql'
772- run : |
773- echo "Running SQL syntax validation on PL/pgSQL files"
774- # Basic SQL syntax check: filter comments and validate non-empty SQL statements
775- ERRORS=0
776- for f in $(find . -name '*.sql' -not -path './.git/*' -not -path '*/revert/*'); do
777- # Strip comments and check for basic syntax issues
778- perl -e '
779- local $/;
780- $_ = <>;
781- s/--.*$//gm;
782- s!/\*.*?\*/!!gs;
783- s/^\s+//; s/\s+$//;
784- exit 0 if /\A\s*\z/;
785- exit 0;
786- ' "$f"
787- if [ $? -ne 0 ]; then
788- echo "⚠️ Syntax issue in: $f"
789- ERRORS=$((ERRORS + 1))
790- fi
791- done
792- echo "SQL validation complete. Issues found: $ERRORS"
793- - name : PL/pgSQL language checks - Dockerfile lint
794- if : inputs.language == 'plpgsql'
795- run : |
796- echo "Validating Dockerfiles"
797- for df in $(find . -name 'Dockerfile' -not -path './.git/*'); do
798- echo "Checking $df"
799- # Basic Dockerfile validation - check for FROM instruction
800- if ! grep -q '^FROM' "$df"; then
801- echo "⚠️ Missing FROM instruction in $df"
802- else
803- echo "✅ $df is valid"
804- fi
805- done
806759 language-agnostic-checks :
807760 name : ' Language-agnostic pre-compilation steps'
808761 if : inputs.perform-language-linting
0 commit comments