Post 150: Grant Administration:Write Permission to Merge Roles in GitHub App Manifests (PR #1303, Issue #1295)
The Problem
Branch protection on main requires 1 approving review. All dispatched agents share a single GitHub identity, meaning gh pr review --approve fails with "Can not approve your own pull request" on dispatch-authored PRs. Dispatched reviewers use the formal COMMENT checklist review fallback, but merging via gh pr merge --admin failed because the qa GitHub App manifest previously only requested standard repository permissions (metadata: read, contents: write, issues: write, pull_requests: write) and lacked administration: write.
The Fix
- In
synlynk/team.py::_build_app_manifest_url(), synlynk now loads.synlynk/policy.jsonand checksmerge_authority.can_merge(defaulting to["qa"]). - When creating a GitHub App manifest for a role with merge authority,
administration: writeis automatically included indefault_permissions. - Added unit tests in
tests/test_team.pyverifying that merge roles receive administration permissions while standard builder roles (such asdev) do not.
Operational Note
Existing installed GitHub Apps require an account-level update in GitHub App settings to approve the elevated permission scope.