forked from mineiros-io/terraform-github-repository
-
Notifications
You must be signed in to change notification settings - Fork 1
/
secrets.tf
19 lines (15 loc) · 809 Bytes
/
secrets.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# ---------------------------------------------------------------------------------------------------------------------
# Action Secrets
# ---------------------------------------------------------------------------------------------------------------------
locals {
plaintext_secrets = { for name, value in var.plaintext_secrets : name => { plaintext = value } }
encrypted_secrets = { for name, value in var.encrypted_secrets : name => { encrypted = value } }
secrets = merge(local.plaintext_secrets, local.encrypted_secrets)
}
resource "github_actions_secret" "repository_secret" {
for_each = local.secrets
repository = github_repository.repository.name
secret_name = each.key
plaintext_value = try(each.value.plaintext, null)
encrypted_value = try(each.value.encrypted, null)
}