Skip to content

fix(repository): support single-maintainer protection and trim blank lines - #6

Merged
PerfectPan merged 1 commit into
mainfrom
fix/solo-maintainer-protection
Sep 30, 2026
Merged

PerfectPan merged 1 commit into
mainfrom
fix/solo-maintainer-protection

Conversation

@PerfectPan

Copy link
Copy Markdown
Owner

Title format: type(scope): summary

Summary

  • configure-github-repository.sh takes --approvals N (default 1) and repeatable --check NAME.
  • Trailing blank lines removed from six template files.

Motivation

  • The hard-coded single approval blocks a sole maintainer from merging their own PRs, found while adopting the template in svgo.mbt.
  • Downstream repositories copying .editorconfig, bug_report.md and others failed git diff --cached --check in the pre-commit hook.

Implementation Notes

  • --approvals 0 also turns off require_last_push_approval, which needs an approver.
  • --check values are appended to the three Review checks; names containing quotes or backslashes are rejected because the payload is built as JSON text.
  • CONTRIBUTING documents the single-maintainer option and says to extend an existing ruleset rather than layer classic protection on top.

Validation

  • Repository checks: ./scripts/check-repository.sh --staged ok; git diff --cached --check clean.
  • Default dry run: contexts are the three Review checks, one approval, last-push approval on.
  • --approvals 0 --check "verify (ubuntu-latest)" --check "verify (macos-latest)": five contexts, zero approvals, last-push approval off; payload parses as JSON.
  • --approvals x exits 1 with a clear error.
  • No tracked file ends with a blank line (tail -c2 scan over git ls-files).

Skipped gates and reasons:

  • --apply not run: it would change a real repository's protection.

Evidence

  • Dry-run outputs above.

Safety Checklist

  • No credentials, tokens, private hostnames, personal filesystem paths, or generated logs are included.
  • Local config, generated output, build artifacts, and temporary workspaces are not staged.
  • User-facing behavior, docs, changelog, migrations, or rollback notes are updated when relevant.
  • Completed Spec/Plan constraints are migrated to tests or current-state docs before retirement; unfinished scope remains active.
  • The branch is current enough for review, and the remote head matches the intended commit.

Follow-up Risks

  • Repositories using rulesets still need their checks added to the ruleset by hand.

…lines

configure-github-repository.sh hard-coded one approving review, which a
sole maintainer cannot satisfy. It now takes --approvals N and extra
required checks via --check NAME.

Several template files ended with a blank line, so repositories copying
them failed `git diff --cached --check` in the pre-commit hook.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@PerfectPan
PerfectPan merged commit 25f716a into main Sep 30, 2026
3 checks passed
@PerfectPan
PerfectPan deleted the fix/solo-maintainer-protection branch September 30, 2026 17:32
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