File tree Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,23 @@ export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
50
50
51
51
[ tf-gh-auth ] : https://registry.terraform.io/providers/integrations/github/latest/docs#authentication
52
52
53
+ ### Creating Environments
54
+
55
+ You can define multiple Github Actions Environments by defining a ` map `
56
+ of environment definitions.
57
+
58
+ ``` hcl
59
+ module "gh-env" {
60
+ source = "tbobm/environments/github"
61
+
62
+ repository = "tbobm/terraform-github-secrets"
63
+
64
+ environments = {
65
+ "stable" = { }
66
+ }
67
+ }
68
+ ```
69
+
53
70
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
54
71
## Requirements
55
72
@@ -71,8 +88,8 @@ No modules.
71
88
72
89
| Name | Type |
73
90
| ------| ------|
74
- | [ github_actions_secret.example_secret ] ( https://registry.terraform.io/providers/integrations/github/latest/docs/resources/actions_secret ) | resource |
75
- | [ github_repository.repo ] ( https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/repository ) | data source |
91
+ | [ github_repository_environment.this ] ( https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository_environment ) | resource |
92
+ | [ github_repository.this ] ( https://registry.terraform.io/providers/integrations/github/latest/docs/data-sources/repository ) | data source |
76
93
77
94
## Inputs
78
95
Original file line number Diff line number Diff line change 1
- data "github_repository" "repo " {
1
+ data "github_repository" "this " {
2
2
full_name = var. repository
3
3
}
Original file line number Diff line number Diff line change 1
- resource "github_actions_secret" "example_secret" {
2
- repository = " example_repository"
3
- secret_name = " example_secret_name"
4
- plaintext_value = " hello"
1
+ resource "github_repository_environment" "this" {
2
+ for_each = var. environments
3
+
4
+ repository = data. github_repository . this . name
5
+ environment = each. key
5
6
}
You can’t perform that action at this time.
0 commit comments