feat(scripts/githooks): restore pre-push hook with allowlist (#22980)

The pre-push hook was removed in #22956. This restores it with a
reduced scope (tests + site build) and an allowlist so it only runs
for developers who opt in.

Two opt-in mechanisms:

- git config coder.pre-push true (local, not committed)
- CODER_WORKSPACE_OWNER_NAME allowlist in the hook script

git config takes priority and also supports explicit opt-out for
allowlisted users (git config coder.pre-push false).

Refs #22956

---------

Co-authored-by: Cian Johnston <cian@coder.com>
This commit is contained in:
Mathias Fredriksson
2026-03-12 12:13:55 +02:00
committed by GitHub
co-authored by Cian Johnston
parent e7e2de99ba
commit 660a3dad21
5 changed files with 98 additions and 11 deletions
+1
View File
@@ -3,6 +3,7 @@
# Pre-commit hook that runs CI-equivalent checks locally.
# Runs `make pre-commit` (gen, fmt, lint, typos, build) which
# catches most CI failures without needing Docker or Playwright.
# Heavier checks (tests, site build) run via the pre-push hook.
#
# Installation (worktree-compatible):
#