Skip to content

Add team access copying feature for repositories#317

Open
ataylorme wants to merge 1 commit intobetter-auth:mainfrom
taylor-tech-ventures:claude/github-team-access-copy-bwzFL
Open

Add team access copying feature for repositories#317
ataylorme wants to merge 1 commit intobetter-auth:mainfrom
taylor-tech-ventures:claude/github-team-access-copy-bwzFL

Conversation

@ataylorme
Copy link
Copy Markdown

Summary

This PR adds functionality to copy team permissions from one repository to another within the same organization. It includes a new UI component that prompts users to copy team access when a new repository is created, along with server-side actions and AI tool integrations.

Key Changes

  • New Component: CopyTeamAccessPrompt - A dialog component that appears after repository creation, allowing users to copy team permissions from an existing repository. Features include:

    • Form to specify source repository
    • Real-time feedback with success/error indicators
    • Per-team result display with permission levels
    • Graceful error handling
  • Server Actions: New team-actions.ts file with three main functions:

    • listRepoTeams() - Fetch teams with access to a repository
    • addTeamsToRepo() - Add multiple teams to multiple repositories
    • copyRepoTeamAccess() - Copy all team permissions from source to target repositories
  • AI Tools: Added three new tools to the AI command route:

    • listRepoTeams - List teams and their access levels for a repository
    • addTeamsToRepo - Add teams to repositories with specified permissions
    • copyRepoTeamAccess - Copy team access from source to target repositories
  • Integration: Updated app layout to include the CopyTeamAccessPrompt component, which subscribes to repo:created mutation events

Implementation Details

  • Uses mutation event provider pattern to trigger the prompt when a new repository is created
  • Handles concurrent operations with Promise.allSettled() for robust error handling
  • Supports batch operations across multiple repositories and teams
  • Provides detailed per-team feedback with GitHub URLs for teams
  • Implements proper permission level mapping (pull→Read, push→Write, etc.)

https://claude.ai/code/session_01EoNgSxjdMomvP6da9zgKrf

- New server actions in team-actions.ts: listRepoTeams, addTeamsToRepo,
  copyRepoTeamAccess (uses Octokit teams API)
- Three new AI command palette tools: listRepoTeams (returns markdown
  table with linked team names + read/write/admin labels, API noise
  stripped), addTeamsToRepo, copyRepoTeamAccess
- CopyTeamAccessPrompt component subscribes to repo:created mutation
  events and opens a dialog prompting the user to copy team access from
  an existing source repo to the newly created (target) repo
- Mount CopyTeamAccessPrompt in app layout inside MutationEventProvider

https://claude.ai/code/session_01EoNgSxjdMomvP6da9zgKrf
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 11, 2026

@claude is attempting to deploy a commit to the better-auth Team on Vercel.

A member of the Team first needs to authorize it.

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.

2 participants