Files
Charon/scripts/pre-commit-hooks/block-codeql-db-commits.sh
GitHub Actions 8294d6ee49 Add QA test outputs, build scripts, and Dockerfile validation
- Created `qa-test-output-after-fix.txt` and `qa-test-output.txt` to log results of certificate page authentication tests.
- Added `build.sh` for deterministic backend builds in CI, utilizing `go list` for efficiency.
- Introduced `codeql_scan.sh` for CodeQL database creation and analysis for Go and JavaScript/TypeScript.
- Implemented `dockerfile_check.sh` to validate Dockerfiles for base image and package manager mismatches.
- Added `sourcery_precommit_wrapper.sh` to facilitate Sourcery CLI usage in pre-commit hooks.
2025-12-11 18:26:24 +00:00

15 lines
636 B
Bash

#!/usr/bin/env bash
set -euo pipefail
staged=$(git diff --cached --name-only | tr '\r' '\n' || true)
if [ -n "${staged}" ]; then
# Exclude the pre-commit-hooks directory and this script itself
filtered=$(echo "$staged" | grep -v '^scripts/pre-commit-hooks/' | grep -v '^data/backups/' || true)
if echo "$filtered" | grep -q "codeql-db"; then
echo "Error: Attempting to commit CodeQL database artifacts (codeql-db)." >&2
echo "These should not be committed. Remove them or add to .gitignore and try again." >&2
echo "Tip: Use 'scripts/repo_health_check.sh' to validate repository health." >&2
exit 1
fi
fi
exit 0