From bc74d022906558647a5aa114ae28875c534e3cf6 Mon Sep 17 00:00:00 2001 From: shcommit Date: Tue, 1 Sep 2026 09:45:15 +0900 Subject: [PATCH 1/2] feat(ci): add .githooks/pre-push to prevent direct pushes to develop/master --- .githooks/pre-push | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 .githooks/pre-push diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..99ab654 --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,17 @@ +#!/bin/bash +# .githooks/pre-push +# Prevents direct git push to protected branches (develop, master) + +protected_branches="^(develop|master)$" + +while read local_ref local_oid remote_ref remote_oid; do + target_branch="${remote_ref#refs/heads/}" + + if [[ "$target_branch" =~ $protected_branches ]]; then + echo "❌ [Direct Push Blocked] '$target_branch' 브랜치로 직접 push하는 것은 금지되어 있습니다." + echo " 반드시 feature/* 또는 fix/* 브랜치에서 PR(Pull Request)을 올려 병합하세요!" + exit 1 + fi +done + +exit 0 From 21d5bc766ce8ec816bbb7357af23d0f346bbb4df Mon Sep 17 00:00:00 2001 From: shcommit Date: Tue, 1 Sep 2026 09:45:32 +0900 Subject: [PATCH 2/2] docs: record .githooks/pre-push in changelog and handoff --- changelog.md | 2 ++ handoff.md | 1 + 2 files changed, 3 insertions(+) diff --git a/changelog.md b/changelog.md index a5fd9d2..d069c4b 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,8 @@ Lightweight human-readable summary of meaningful repository changes. ## Unreleased +- Added `.githooks/pre-push` script to block direct local `git push` to protected branches (`develop`, `master`) + and direct contributors to use Pull Requests (`feature/*` / `fix/*`). - Added Conventional Commits PR title validation job (`pr-title-check`) to GitHub Actions workflow (`.github/workflows/test.yml`) to enforce standard title format (`feat:`, `fix:`, `docs:`, etc.) for pull requests. - Updated `.github/PULL_REQUEST_TEMPLATE.md` with Conventional Commits title format guide and an explicit Examples Impact checklist diff --git a/handoff.md b/handoff.md index a84ceca..dd3da45 100644 --- a/handoff.md +++ b/handoff.md @@ -12,6 +12,7 @@ Examples redesign, Korean documentation, automated verification pipeline, `v0.2. - `scripts/verify_examples.py`: `--check` (executes example workflows in isolated temp repo) & `--update` (auto-updates JSON output snippets when CLI outputs change). - `tests/integration/test_examples.py`: Integration test ensuring 100% executable example parity in `pytest`. - **v0.2.1 Release**: Bumped version to `0.2.1`, synced manifests (`SKILL.md`, `.claude-plugin/plugin.json`, `adapters/gemini-cli/gemini-extension.json`), tagged `v0.2.1` on `master`, merged via Git Flow, and pushed to `origin`. +- **Git Pre-push Hook (`.githooks/pre-push`)**: Created pre-push hook configured via `git config core.hooksPath .githooks` to block direct local pushes to `develop` and `master`, enforcing PR-based merges. - **PR Title Linter & PR Template**: Added `pr-title-check` CI job to `.github/workflows/test.yml` enforcing Conventional Commits format (`feat:`, `fix:`, `docs:`, etc.) and updated `.github/PULL_REQUEST_TEMPLATE.md` with explicit Examples Impact checklist for `feat:`/`fix:` changes. - **Lifecycle Report**: Recorded automation strategy in `automated_examples_lifecycle_report.md` artifact.