Commit graph access/.github
Author SHA1 Message Date
Paul Carleton
65b5a43451
Manage GitHub org settings and org-role assignments via Pulumi (#107)
* Manage GitHub org settings and org-role assignments via Pulumi

Brings two click-ops org-level configs under IaC and tightens defaults:

- OrganizationSettings: default_repository_permission read -> none so
  private repos are not implicitly readable by every member; repo
  creation restricted to admins; billingEmail from Pulumi secret;
  security new-repo defaults pinned so the provider does not reset them.
- Org-role assignments: codify lead/core-maintainers -> all_repo_admin.
  moderators -> all_repo_triage and anthropic -> all_repo_write are
  intentionally omitted (being removed).

* Fix config namespace: use project namespace for githubBillingEmail

The github: namespace is reserved for the @pulumi/github provider's own
config keys, so github:billingEmail was rejected as an unknown provider
option. Use the project default namespace instead. preview.yml uses the
same --config flag pattern as the existing Discord secrets.
2026-04-30 13:30:54 +00:00
Paul Carleton
c858a8f5de
Remove one-time auth-maintainers import from deploy workflow (#57)
* Import auth-maintainers team into Pulumi state with correct ID

The auth-wg -> auth-maintainers rename (PR #50) caused the team to be
lost from Pulumi state. A previous import attempt used the wrong team
ID (14435880). The actual GitHub team ID is 16083315.

Every deploy since has failed with:
  422 Validation Failed: Name must be unique for this org

This adds a one-time import step to reconcile state. The import line
should be removed after the next successful deploy.

* Remove one-time auth-maintainers import from deploy workflow

The import in the previous commit successfully reconciled the
auth-maintainers team (ID 16083315) into Pulumi state. This
removes the one-time import line now that state is consistent.
2026-02-04 14:38:04 +00:00
Paul Carleton
3b920558b5
Import auth-maintainers team into Pulumi state with correct ID (#55)
The auth-wg -> auth-maintainers rename (PR #50) caused the team to be
lost from Pulumi state. A previous import attempt used the wrong team
ID (14435880). The actual GitHub team ID is 16083315.

Every deploy since has failed with:
  422 Validation Failed: Name must be unique for this org

This adds a one-time import step to reconcile state. The import line
should be removed after the next successful deploy.
2026-02-04 11:02:40 +00:00
David Soria Parra
8dfcc359a0
Remove one-time state cleanup commands (auth-maintainers now created) 2026-02-03 15:17:18 +00:00
David Soria Parra
c147e113f1
Use --target-dependents flag for state delete 2026-02-03 15:13:23 +00:00
David Soria Parra
d694bbbf7d
Fix state delete order and add --force flag 2026-02-03 15:11:36 +00:00
David Soria Parra
2d5b2f4f71
Delete stale auth-maintainers resources from Pulumi state
The team was accidentally deleted when both auth-wg and auth-maintainers
existed in state pointing to the same GitHub team. Need to clear stale
state so Pulumi can create fresh resources.
2026-02-03 15:09:29 +00:00
David Soria Parra
6627a01b81
Remove one-time import command (auth-maintainers now in state) 2026-02-03 15:04:44 +00:00
David Soria Parra
0827b6049c
Add workflow_dispatch trigger to deploy workflow 2026-02-03 15:02:16 +00:00
David Soria Parra
8f29a9f0ef
Import auth-maintainers team into Pulumi state
The team exists on GitHub but was removed from Pulumi state,
causing deployment failures. This adds a one-time import step.
2026-02-03 15:00:08 +00:00
David Soria Parra
8077a0cb7a
Add CODEOWNERS: require core-maintainers for all changes (#47) 2026-01-28 15:45:18 +00:00
David Soria Parra
a5663db94f
Update ci.yml 2026-01-28 14:53:20 +00:00
David Soria Parra
a1e9b03831
Skip preview workflow for fork PRs
Fork PRs don't have access to repository secrets, causing the GCP
auth and PR comment steps to fail. Instead of failing, skip the
preview job entirely for fork PRs. The job will show as 'skipped'
rather than 'failed', allowing fork PRs to be merged based on
the CI check alone.

Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%)
Claude-Steers: 2
Claude-Permission-Prompts: 1
Claude-Escapes: 0
2026-01-14 09:44:26 +00:00
David Soria Parra
f960494174
Add Discord role sync with role-centric architecture (#22)
* Add Discord role sync with role-centric architecture

This refactors the access management to use a role-centric model where
each role explicitly defines which platforms it exists on (GitHub,
Discord, Google).

Key changes:
- Add Discord role sync via Pulumi Dynamic Provider
- Replace groups.ts with roleIds.ts + roles.ts for type-safe role definitions
- Use ROLE_IDS constants to prevent typos in memberOf references
- Each role has platform-specific config (github/discord/google keys)
- Discord-only roles (e.g., administrators) and GitHub-only roles
  (e.g., typescript-sdk-auth) are now explicitly modeled
- Add PR preview workflow to show Pulumi changes before merge
- Add test-config.ts for config structure validation
- Fix typo: docs-maintaners -> docs-maintainers

Discord roles will match existing server roles:
- administrators, lead maintainers, core maintainers
- sdk maintainers, working groups, interest groups
- etc.

Requires new GitHub secrets:
- DISCORD_BOT_TOKEN
- DISCORD_GUILD_ID

* Fix GitHub team ordering and make Discord integration optional

- Add topological sort for GitHub teams to ensure parent teams are
  created before child teams, fixing the registry-wg parentTeamId issue
- Make Discord integration optional by using config.get() instead of
  config.require(), allowing CI preview to succeed without Discord secrets
- Add sortRolesByGitHubDependency() utility function in config/utils.ts

Claude-Generated-By: Claude Code (cli/claude-opus-4-5=20%)
Claude-Steers: 2
Claude-Permission-Prompts: 1
Claude-Escapes: 0

* Reconcile Discord roles for listed users

Replace per-role-membership approach with per-user role sync that:
- Adds missing roles users should have
- Removes managed roles users shouldn't have
- Only touches roles defined in config (won't affect admin roles, etc.)

Users not in config remain untouched.

Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%)
Claude-Steers: 4
Claude-Permission-Prompts: 1
Claude-Escapes: 0

* Fix descriptions to match existing resources

* Cache Pulumi plugins and fix GITHUB_TOKEN for pulumi install

* Remove accidentally committed state backup

* Use github.token for pulumi install

* Fix formatting

Fix deploy: add pulumi login before config set

Fix deploy: set PULUMI_CONFIG_PASSPHRASE_FILE for config commands

Import existing docs-maintainers team (remove after deploy)

Remove docs-maintainers import workaround

Add docs-maintainers cleanup to state cleanup

Add pulumi refresh before up to sync state with reality

Rename Discord roles to add (synced) suffix

Cleanup Makefile and add lead-maintainers GitHub team
2026-01-13 23:35:18 +00:00
David Soria Parra
c47f7692c3
Use GITHUB_TOKEN env var for Pulumi GitHub provider
Pass the token via GITHUB_TOKEN environment variable which the Pulumi
GitHub provider reads automatically. Remove the one-time migration
workflow since state cleanup already succeeded.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 17:48:40 +00:00
David Soria Parra
609880c57f
Add one-time migration workflow to set GitHub token and clean up state
- Add migrate-state.yml workflow (manual trigger) that:
  - Sets github:token in Pulumi config from PULUMI_GITHUB_TOKEN secret
  - Cleans up orphaned 'core' team memberships from state
  - Commits the updated Pulumi.prod.yaml back to repo
- Revert deploy.yml to use encrypted token from Pulumi config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 17:46:16 +00:00
David Soria Parra
dd446c3dab
Use GitHub secret for Pulumi GitHub token instead of encrypted config
Move GitHub token from Pulumi encrypted config to GitHub Actions secret
(PULUMI_GITHUB_TOKEN) for better secret management. The token is passed
via GITHUB_TOKEN env var which the Pulumi GitHub provider reads automatically.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 17:40:00 +00:00
David Soria Parra
3c1d641add
Add prettier formatting and CI validation checks
- Add prettier with consistent formatting config
- Add format and format:check npm scripts
- Add prettier pre-commit hook
- Add validation and formatting checks to CI workflow
- Reformat all TypeScript and JSON files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 10:01:28 +00:00
adam jones
5b2b01db21
Use intermediate env var for Pulumi passphrase (#4)
Addresses security concern where secrets were directly interpolated in
run commands. Following GitHub's security best practices, the secret is
now passed through an intermediate environment variable before being
written to the file.

This maintains compatibility with the existing Makefile workflow while
reducing the risk of accidental secret disclosure.
2025-10-01 01:08:42 +01:00
Adam Jones
d3a3ea32f7
ci: Ensure googleworkspace sdk setup 2025-09-20 02:54:01 +00:00
Adam Jones
e3f0af2f94
Initial commit 2025-09-20 02:47:33 +00:00