Some checks failed
CI Pipeline / Rust Format Check (push) Successful in 6s
CI Pipeline / Clippy Lints (push) Successful in 46s
CI Pipeline / Rust Unit Tests (push) Successful in 1m1s
CI Pipeline / Security Audit (push) Successful in 4s
CI Pipeline / Frontend Lint & Type Check (push) Failing after 10s
CI Pipeline / Build .deb & Release (push) Has been skipped
- Added HealthCheckListResponse type { checks: [...], total: number }
- Updated healthChecksApi.list() return type to HealthCheckListResponse
- Fixed HostDetailPage to use res.data?.checks instead of Array.isArray
- Added Target column to health checks table
- Added git pre-commit/pre-push hooks to prevent format CI failures
- Updated lessons.md
38 lines
1.6 KiB
Bash
Executable File
38 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# =============================================================================
|
|
# Linux Patch Manager — Pre-Push Hook
|
|
# =============================================================================
|
|
# Safety net: verifies cargo fmt and frontend build pass before pushing.
|
|
# Install: ./scripts/git-hooks/install.sh
|
|
# =============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
FAILED=0
|
|
|
|
# ── Rust format check ────────────────────────────────────────────────────────
|
|
if [[ -f "${REPO_ROOT}/Cargo.toml" ]]; then
|
|
echo "[pre-push] Checking Rust formatting ..."
|
|
if ! cargo fmt --all --manifest-path "${REPO_ROOT}/Cargo.toml" --check 2>/dev/null; then
|
|
echo "[pre-push] ❌ Rust formatting check FAILED. Run: cargo fmt --all"
|
|
FAILED=1
|
|
fi
|
|
fi
|
|
|
|
# ── Frontend type check ─────────────────────────────────────────────────────
|
|
if [[ -f "${REPO_ROOT}/frontend/package.json" ]]; then
|
|
echo "[pre-push] Checking TypeScript types ..."
|
|
if ! (cd "${REPO_ROOT}/frontend" && npx tsc --noEmit 2>/dev/null); then
|
|
echo "[pre-push] ❌ TypeScript type check FAILED."
|
|
FAILED=1
|
|
fi
|
|
fi
|
|
|
|
if [[ ${FAILED} -ne 0 ]]; then
|
|
echo "[pre-push] Push rejected — fix errors above before pushing."
|
|
exit 1
|
|
fi
|
|
|
|
echo "[pre-push] All checks passed ✓"
|