Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .husky/hooks/test-runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ fi

# Run tests
echo " - Running tests..."
if pytest --html=tests/test-report/test-report.html; then
# HTML report only when pytest-html is installed (it is optional)
HTML_ARGS=""
if python -c "import pytest_html" 2>/dev/null; then
HTML_ARGS="--html=tests/test-report/test-report.html"
fi
if pytest $HTML_ARGS; then
echo " ✅ All tests passed"
else
echo " ❌ Tests failed. Please fix before pushing."
Expand Down
10 changes: 10 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env sh
# >>> GitGuardian secret scan (managed by Contentstack Security) >>>
if [ -z "${CI:-}" ]; then
if ! command -v ggshield >/dev/null 2>&1; then
echo "ggshield is not installed - secret scanning is required. Setup: https://contentstack.atlassian.net/wiki/x/FIDVEwE" >&2
exit 1
fi
ggshield secret scan pre-commit || exit 1
fi
# <<< GitGuardian secret scan <<<

# Pre-commit hook to run Talisman and Snyk scans, completing both before deciding to commit

# Function to check if a command exists
Expand Down
17 changes: 16 additions & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
#!/usr/bin/env sh
# >>> GitGuardian secret scan (managed by Contentstack Security) >>>
if [ -z "${CI:-}" ]; then
if ! command -v ggshield >/dev/null 2>&1; then
echo "ggshield is not installed - secret scanning is required. Setup: https://contentstack.atlassian.net/wiki/x/FIDVEwE" >&2
exit 1
fi
ggshield secret scan pre-push "$@" || exit 1
fi
# <<< GitGuardian secret scan <<<


echo "🚀 Running pre-push checks..."

Expand All @@ -10,7 +20,12 @@ fi

# Run tests to ensure code quality
echo "🧪 Running tests..."
if ! pytest --html=tests/test-report/test-report.html; then
# HTML report only when pytest-html is installed (it is optional)
HTML_ARGS=""
if python -c "import pytest_html" 2>/dev/null; then
HTML_ARGS="--html=tests/test-report/test-report.html"
fi
if ! pytest $HTML_ARGS; then
echo "❌ Tests failed. Please fix before pushing."
exit 1
fi
Expand Down
3 changes: 2 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
* @contentstack/developer-ecosystem-pr-reviewers
.github/workflows/ @contentstack/security-admin
**/.snyk @contentstack/security-admin
**/CODEOWNERS @contentstack/security-admin
**/CODEOWNERS @contentstack/security-admin
**/.gitguardian.yaml @contentstack/security-admin
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ lxml~=6.1.0
ruff==0.11.5
pytest>=7.0.0
pytest-cov>=4.0.0
pytest-html>=4.2.0
black>=26.3.1
flake8>=6.0.0
isort>=5.0.0
Loading