integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
905 stars 746 forks source link

[FEAT]: `github_user_email` #2070

Closed fishpen0 closed 1 month ago

fishpen0 commented 10 months ago

Describe the need

We'd like a new resource github_user_email for adding and removing email addresses to the github user we use as a service account for CI/CD. Basically each environment and project has an email associated with a cloud provider service account. Those pipeline runs sign commits as that email address, so we'd like to be able to dynamically add and remove email addresses to the Github Bot user whever we are adding and removing GPG keys.

Example use with a generic cloud provider service account:

data "cloud_provider_service_account" "example" {
  name = "myenvironment@myproject.iam.mycloudprovider.com"
}

resource "github_user_gpg_key" "example" {
  armored_public_key = cloud_provider_service_account.example.public_key
}

resource "github_user_email" "example" {
  email_address = cloud_provider_service_account.example.name
}

SDK Version

No response

API Version

No response

Relevant log output

No response

Code of Conduct

github-actions[bot] commented 1 month ago

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!