GH-119: Makefile-based git hooks setup#122
Conversation
|
🤖 Validation Passed
|
There was a problem hiding this comment.
Pull request overview
Adds a Makefile-driven setup flow for local git hooks and introduces a pre-push hook under .github/hooks, alongside helper Makefile targets for building/debugging the GitHub Pages site.
Changes:
- Adds a
check-hooksMakefile target and wires it into the default Makefile flow. - Introduces
.github/hooks/pre-pushto enforce a branch naming convention before pushing. - Adds Makefile targets to build/serve the Zola-based GitHub Pages site via Docker.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| Makefile | Adds default hook setup, Zola docker helpers, and a check-hooks target that sets core.hooksPath. |
| .github/hooks/pre-push | Adds a pre-push branch-name validation hook. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| check-hooks: | ||
| ifeq (${VERBOSE},1) | ||
| @echo "⚙️ Configuring local git hooks..." | ||
| endif | ||
| @git config core.hooksPath $(HOOKS_PATH) | ||
| @chmod +x $(HOOKS_PATH)/* |
There was a problem hiding this comment.
The check-hooks target mutates the repo’s git configuration (core.hooksPath) as part of the default build path. This can unexpectedly change contributors’ local .git/config just by running make. Consider making hook configuration an explicit opt-in target (e.g., setup-hooks) or gating it behind an environment flag, and keep default focused on build/test operations.
| docker run -v `pwd`:/tmp -p 1111:1111 -w /tmp ghcr.io/getzola/zola:v0.18.0 -r .github/pages build | ||
|
|
||
| github-pages-debug: | ||
| docker run -v `pwd`:/tmp -p 1111:1111 -w /tmp ghcr.io/getzola/zola:v0.18.0 -r .github/pages serve -i 0.0.0.0 |
There was a problem hiding this comment.
The docker run -v pwd:/tmp volume argument is unquoted, so paths containing spaces will break. Consider using $(PWD) (or $(shell pwd)) with quoting for the bind mount, and adding --rm to avoid leaving stopped containers behind.
| docker run -v `pwd`:/tmp -p 1111:1111 -w /tmp ghcr.io/getzola/zola:v0.18.0 -r .github/pages build | |
| github-pages-debug: | |
| docker run -v `pwd`:/tmp -p 1111:1111 -w /tmp ghcr.io/getzola/zola:v0.18.0 -r .github/pages serve -i 0.0.0.0 | |
| docker run --rm -v "$(PWD)":/tmp -p 1111:1111 -w /tmp ghcr.io/getzola/zola:v0.18.0 -r .github/pages build | |
| github-pages-debug: | |
| docker run --rm -v "$(PWD)":/tmp -p 1111:1111 -w /tmp ghcr.io/getzola/zola:v0.18.0 -r .github/pages serve -i 0.0.0.0 |
This PR introduces the following changes:
check-hookssetupgithooks from.githhooksto.github/hooks