Skip to content

Conversation

@aRustyDev
Copy link
Owner

  • Adding rulesets for protecting github branches
  • Adding justfile recipes for applying rulesets to github repo

…epo default

- Add `init` recipe for interactive first-time setup
- Add `set-target` recipe for non-interactive target_repo changes
- Add `target_repo` global variable as default for all repo parameters
- Replace shell `$(dirname "$0")` with `justfile_directory()`
- Replace shell path checks with `path_exists()`
- Add `_require-repo`, `_require-file`, `_require-dir` validation helpers
- Remove redundant `echo ""` statements throughout
- Remove unnecessary shell variable assignments (use just params directly)
- Mark internal recipes with `[private]` attribute
- Simplify heredocs to inline strings for just compatibility
Split branch protection rulesets into two categories:
- Core protection (no bypass): deletion, force-push, linear history
- PR reviews (with bypass): review requirements for aRustyDev

This enables the user aRustyDev to bypass the required_approving_review_count
rule while still being subject to all core branch protections.

New files:
- .github/rulesets/main-pr-reviews.json
- .github/rulesets/integration-pr-reviews.json

Modified:
- .github/rulesets/main-branch-protection.json (removed PR rules)
- .github/rulesets/integration-branch-protection.json (removed PR rules)
- .ai/docs/strategies/protect-github-repo.md (updated documentation)
GitHub repository-level rulesets do not support "User" as an actor_type.
Valid types are: Integration, OrganizationAdmin, RepositoryRole, Team, DeployKey.

Changed bypass_actors to use:
- actor_type: "RepositoryRole"
- actor_id: 5 (Repository Admin/Owner role)

This allows repository admins to bypass PR review requirements while
still being subject to core branch protections.
Added --silent flag to gh api commands to prevent the JSON response
from being piped through a pager (vim/less), allowing the recipe to
run non-interactively.
feat(just): Add repository branch protection justfile entries
@aRustyDev aRustyDev self-assigned this Dec 7, 2025
@aRustyDev aRustyDev merged commit f88c913 into main Dec 7, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in MCP Server Development Dec 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants