8000 Require PRs for every change and block sensitive info by Thoan · Pull Request #2 · Thoan/ai · GitHub
[go: up one dir, main page]

Skip to content

Require PRs for every change and block sensitive info - #2

Merged
Thoan merged 1 commit into
mainfrom
protect-main
Oct 29, 2026
Merged

Thoan merged 1 commit into
mainfrom
protect-main

Conversation

@Thoan
@Thoan Thoan commented Oct 29, 2026
Copy link
Copy Markdown
Owner

Why

main should only change through reviewed PRs, and personal or machine info (emails, home paths, device IDs, secrets) should never reach this public repo.

What changed

  • scripts/check-sensitive.sh fails on:
    • a commit author/committer email that isn't a GitHub noreply address
    • an email in added content (GitHub/Anthropic noreply allowed)
    • a local home path (/Users/<name>, /home/<name>)
    • an Apple device or simulator ID
  • sensitive-check workflow runs that script plus gitleaks on every PR and on pushes to main. It will be the required check for merging.
  • .githooks/pre-commit runs the same check locally (opt in with git config core.hooksPath .githooks).
  • Landing goes through a PR. The land skill and lander push a branch, open a PR, wait for checks, then rebase-merge. Nothing pushes to the default branch.
  • README documents the rules and the hook.

After merge (repo settings, applied separately)

  • Ruleset on main: PR required, the sensitive-check status check required, no force-push, no deletion, no bypass (owner included).
  • Merge method: rebase only (commits land exactly as written), and branches are deleted on merge.
  • Secret scanning + push protection: already on.

Verified

  • The check passes on the full repo history and on this branch.
  • Negative test in a throwaway clone: a personal email, /Users/<name> path and simulator UDID in staged content, plus a commit authored with a personal email, were all flagged (exit 1). Clean content passes (exit 0).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LwG41BKPezSJuGPH9JGBuM

- scripts/check-sensitive.sh fails on non-noreply commit emails, emails in
  added content (GitHub/Anthropic noreply allowed), local home paths and
  device/simulator ids; runs in CI and as an opt-in pre-commit hook
- sensitive-check workflow runs it plus gitleaks on every PR and push to main
- land skill and lander now land through a pull request (push branch, open
  PR, wait for checks, rebase-merge); nothing pushes to the default branch
- orchestration skill and README state the PR-only rule; README documents
  the protections and the hook

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LwG41BKPezSJuGPH9JGBuM
@Thoan
Thoan merged commit 151ee00 into main Oct 29, 2026
1 check passed
@Thoan
Thoan deleted the protect-main branch October 29, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0