community icon indicating copy to clipboard operation
community copied to clipboard

feat: sync GitHub teams from config via API with dry-run support

Open BethGriggs opened this issue 7 months ago • 0 comments

feat: sync GitHub teams from config via API with dry-run support

Adds a script to create and manage GitHub teams based on a YAML config file. Supports parent-child team relationships and a --dry-run mode to preview changes without applying them.

Also creates an initial configuration for community-plugins teams.

This replaces the earlier proof-of-concept from https://github.com/backstage/community-plugins/pull/3946 with a functional implementation using the GitHub API.

chore: assign community-plugins-maintainers as CODEOWNERS for team config


Example of output:

$ node team-sync --config ./TEAMS/community-plugins-teams.yaml --dry-run
📄 Using config: /Users/bgriggs/backstage/backstage-community/github-teams/TEAMS/community-plugins-teams.yaml

🔧 Syncing team "community-plugins-rbac":
   🛠️ (dry-run) Would create team "community-plugins-rbac" under "community-plugin-owners"
   ➕ (dry-run) Would add "AndrienkoAleksandr"
   ➕ (dry-run) Would add "christoph-jerolimov"
   ➕ (dry-run) Would add "divyanshiGupta"
   ➕ (dry-run) Would add "PatAKnight"
   ➕ (dry-run) Would add "dzemanov"

✅ Team sync complete (dry-run mode).

I additionally tested this against a mock GitHub state where it does add/remove users to align with the config file.

BethGriggs avatar May 29 '25 14:05 BethGriggs