Context
PR #1 is up: #1
It adds the CI pipeline, agent instructions, install diagnostics, and Copilot review calibration. Before the workflow is fully live, there are manual GitHub settings to configure and a second PR to create.
Full spec: plans/002-pr-workflow-and-ci.md and plans/002-manual-steps.md
Step 1: Review and merge PR #1
Step 2: Configure GitHub repository settings
All of these are in the GitHub web UI at https://github.com/alex-bezek/dotfiles/settings.
Pull Request settings (Settings → General → Pull Requests)
Branch protection (Settings → Branches → Add rule)
Copilot auto-review (Settings → Rules → Rulesets → New branch ruleset)
Actions permissions (Settings → Actions → General)
Step 3: Sync local repo
After Step 2 settings are configured:
git checkout master && git pull origin master
Step 4: Create PR #2 (pre-push hook)
Create a new branch and add the pre-push hook that blocks direct pushes to master:
git checkout -b ci/pre-push-hook
Create the file git/hooks/pre-push with this content:
#!/usr/bin/env bash
set -euo pipefail
# Block direct pushes to master/main — use PRs instead.
# Applied globally via core.hooksPath.
# Bypass for emergencies: git push --no-verify
while IFS=' ' read -r _local_ref _local_sha remote_ref _remote_sha; do
remote_branch="${remote_ref#refs/heads/}"
if [[ "$remote_branch" == "master" || "$remote_branch" == "main" ]]; then
echo ""
echo "🚫 Direct push to '$remote_branch' is blocked."
echo ""
echo " Create a PR instead: gh pr create"
echo " Emergency bypass: git push --no-verify"
echo ""
exit 1
fi
done
exit 0
Then commit and push:
chmod +x git/hooks/pre-push
git add git/hooks/pre-push
git commit -m "ci: add pre-push hook to block direct pushes to master"
git push -u origin ci/pre-push-hook
gh pr create --title "ci: add pre-push hook to block direct pushes to master" \
--body "Adds pre-push hook blocking direct pushes to master/main. Second and final PR for M1. Validates the full CI + Copilot review loop."
Or ask an AI agent to create this PR — give it the agent prompt and tell it to start at Phase 6.
Step 5: Merge PR #2 and verify the full loop
After PR #2's CI passes and Copilot reviews it:
M1 is complete after this step. The PR workflow is live.
Reference
Context
PR #1 is up: #1
It adds the CI pipeline, agent instructions, install diagnostics, and Copilot review calibration. Before the workflow is fully live, there are manual GitHub settings to configure and a second PR to create.
Full spec: plans/002-pr-workflow-and-ci.md and plans/002-manual-steps.md
Step 1: Review and merge PR #1
lintjob passes on PR #1Step 2: Configure GitHub repository settings
All of these are in the GitHub web UI at https://github.com/alex-bezek/dotfiles/settings.
Pull Request settings (Settings → General → Pull Requests)
Branch protection (Settings → Branches → Add rule)
masterlintCopilot auto-review (Settings → Rules → Rulesets → New branch ruleset)
Copilot Auto ReviewActions permissions (Settings → Actions → General)
Step 3: Sync local repo
After Step 2 settings are configured:
git checkout master && git pull origin masterStep 4: Create PR #2 (pre-push hook)
Create a new branch and add the pre-push hook that blocks direct pushes to master:
Create the file
git/hooks/pre-pushwith this content:Then commit and push:
Or ask an AI agent to create this PR — give it the agent prompt and tell it to start at Phase 6.
Step 5: Merge PR #2 and verify the full loop
After PR #2's CI passes and Copilot reviews it:
git checkout master && git pull origin mastergit push origin mastershould be rejected by the pre-push hookM1 is complete after this step. The PR workflow is live.
Reference