Skip to main content

Module github_hooks

Module github_hooks 

Source
Expand description

The git hooks directory of an agent whose GitHub access goes through AgentMux.

srv writes a script for every client-side hook and points the agent’s core.hooksPath at the directory (identity::github_tokens::apply_agent_git_in). Git looks for each hook there and nowhere else, so the directory has to stand in for the repository’s own (husky, the pre-commit framework, commitlint, git-lfs): every script only starts agentmux-bashwrap git-hook, which runs the repository’s own hook of the same name and, for pre-push (the secret scan) and prepare-commit-msg (the Agent: and owner trailers), does AgentMux’s part. The logic is Rust (crates/bashwrap/src/git_hooks.rs), so the scripts never need to change.

Constants§

HOOK_NAMES
The hooks AgentMux installs: the client-side ones git runs, each forwarded to the repository’s own.

Functions§

ensure_hooks_dir
Write the hooks under root (what is already right is left alone) and return their directory.
hook_script
A hook’s script: git runs hooks through sh, on Windows too.
hooks_dir
This install’s hooks directory, written the first time it is asked for.