Skip to content

Commit b662b4a

Browse files
authored
Merge pull request #10 from Homebrew/fix/emails/fix_email_overrides
fix: allow email overrides
2 parents 489609e + c754f55 commit b662b4a

File tree

8 files changed

+27
-26
lines changed

8 files changed

+27
-26
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ jobs:
4646
GITHUB_TOKEN: ${{ secrets.TF_GH_TOKEN }}
4747
DNSIMPLE_ACCOUNT: ${{ secrets.TF_DNSIMPLE_ACCOUNT }}
4848
DNSIMPLE_TOKEN: ${{ secrets.TF_DNSIMPLE_TOKEN }}
49-
run: tofu plan -no-color -var-file .tfvars -detailed-exitcode
49+
run: |
50+
tofu plan -no-color -detailed-exitcode \
51+
-var-file .tfvars \
52+
-var='email_overrides=${{ secrets.email_overrides }}'
5053
5154
trivy:
5255
name: Trivy

.terraform.lock.hcl

Lines changed: 0 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.tfvars

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ teams = {
115115
"fxcoudert",
116116
"nandahkrishna",
117117
"p-linnane",
118+
"SMillerDev"
118119
],
119120
tsc = [
120121
"Bo98",
@@ -123,6 +124,11 @@ teams = {
123124
"fxcoudert",
124125
"iMichka",
125126
],
127+
analytics = [
128+
"SMillerDev",
129+
"Bo98",
130+
"MikeMcQuaid",
131+
]
126132
},
127133
taps = {
128134
bundle = [

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ User management for the Homebrew organisation using OpenTofu
1414
- `tofu init`
1515
- `tofu plan -var-file .tfvars`
1616

17+
### Secrets
18+
19+
CI requires the following secrets:
20+
21+
- `amazon_role`: The ARN of the AWS role to use for OIDC auth.
22+
- `email_overrides`: Map of GitHub usernames with emails for people who want a different email for tools from their GH email
23+
- `TF_GH_TOKEN`: GitHub token with permissions to manage org teams, users and repo permissions
24+
- `TF_DNSIMPLE_ACCOUNT`: Account ID for DNSimple
25+
- `TF_DNSIMPLE_TOKEN`: Token to authenticate to DNSimple
26+
1727
## TODO
1828

1929
- Google workspace management for brew.sh

github/membership.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ data "github_organization" "homebrew" {
2121
}
2222

2323
locals {
24-
member_emails = tomap({ for key, value in data.github_organization.homebrew.users : key => value.email })
24+
member_emails = tomap({ for key, value in data.github_organization.homebrew.users : value.login => sensitive(value.email) })
2525
}
2626

2727
output "member_emails" {

github/vars.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ variable "teams" {
1212
ops = list(string)
1313
formulae_brew_sh = list(string)
1414
ci-orchestrator = list(string)
15+
analytics = list(string)
1516
})
1617
taps = object({
1718
bundle = list(string)

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ terraform {
1616
}
1717

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

vars.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ variable "teams" {
1212
ops = list(string)
1313
formulae_brew_sh = list(string)
1414
ci-orchestrator = list(string)
15+
analytics = list(string)
1516
})
1617
taps = object({
1718
bundle = list(string)
@@ -27,6 +28,7 @@ variable "github_admins" {
2728
}
2829

2930
variable "email_overrides" {
30-
type = map(string)
31-
default = {}
31+
type = map(string)
32+
sensitive = true
33+
default = {}
3234
}

0 commit comments

Comments
 (0)