Skip to content

Commit

Permalink
Merge pull request #10 from Homebrew/fix/emails/fix_email_overrides
Browse files Browse the repository at this point in the history
fix: allow email overrides
  • Loading branch information
issyl0 authored Jul 15, 2024
2 parents 489609e + c754f55 commit b662b4a
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 26 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ jobs:
GITHUB_TOKEN: ${{ secrets.TF_GH_TOKEN }}
DNSIMPLE_ACCOUNT: ${{ secrets.TF_DNSIMPLE_ACCOUNT }}
DNSIMPLE_TOKEN: ${{ secrets.TF_DNSIMPLE_TOKEN }}
run: tofu plan -no-color -var-file .tfvars -detailed-exitcode
run: |
tofu plan -no-color -detailed-exitcode \
-var-file .tfvars \
-var='email_overrides=${{ secrets.email_overrides }}'
trivy:
name: Trivy
Expand Down
21 changes: 0 additions & 21 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ teams = {
"fxcoudert",
"nandahkrishna",
"p-linnane",
"SMillerDev"
],
tsc = [
"Bo98",
Expand All @@ -123,6 +124,11 @@ teams = {
"fxcoudert",
"iMichka",
],
analytics = [
"SMillerDev",
"Bo98",
"MikeMcQuaid",
]
},
taps = {
bundle = [
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ User management for the Homebrew organisation using OpenTofu
- `tofu init`
- `tofu plan -var-file .tfvars`

### Secrets

CI requires the following secrets:

- `amazon_role`: The ARN of the AWS role to use for OIDC auth.
- `email_overrides`: Map of GitHub usernames with emails for people who want a different email for tools from their GH email
- `TF_GH_TOKEN`: GitHub token with permissions to manage org teams, users and repo permissions
- `TF_DNSIMPLE_ACCOUNT`: Account ID for DNSimple
- `TF_DNSIMPLE_TOKEN`: Token to authenticate to DNSimple

## TODO

- Google workspace management for brew.sh
Expand Down
2 changes: 1 addition & 1 deletion github/membership.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ data "github_organization" "homebrew" {
}

locals {
member_emails = tomap({ for key, value in data.github_organization.homebrew.users : key => value.email })
member_emails = tomap({ for key, value in data.github_organization.homebrew.users : value.login => sensitive(value.email) })
}

output "member_emails" {
Expand Down
1 change: 1 addition & 0 deletions github/vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ variable "teams" {
ops = list(string)
formulae_brew_sh = list(string)
ci-orchestrator = list(string)
analytics = list(string)
})
taps = object({
bundle = list(string)
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ terraform {
}

locals {
# these people can't have their membership managed by OpenTofu becuase they are Billing Managers in GitHub
# these people can't have their membership managed by OpenTofu because they are Billing Managers in GitHub
unmanagable_members = ["p-linnane", "issyl0", "colindean", "MikeMcQuaid", "BrewSponsorsBot"]
}

Expand Down
6 changes: 4 additions & 2 deletions vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ variable "teams" {
ops = list(string)
formulae_brew_sh = list(string)
ci-orchestrator = list(string)
analytics = list(string)
})
taps = object({
bundle = list(string)
Expand All @@ -27,6 +28,7 @@ variable "github_admins" {
}

variable "email_overrides" {
type = map(string)
default = {}
type = map(string)
sensitive = true
default = {}
}

0 comments on commit b662b4a

Please sign in to comment.