Skip to content

Commit ebadd99

Browse files
committed
test: implement generate repository basic (#60)
1 parent 80667d7 commit ebadd99

File tree

9 files changed

+133
-1
lines changed

9 files changed

+133
-1
lines changed

docs/include/terraform.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,6 @@ No modules.
7474
| <a name="output_deploy_key"></a> [deploy\_key](#output\_deploy\_key) | output instance deploy\_key |
7575
| <a name="output_files"></a> [files](#output\_files) | output instance github files |
7676
| <a name="output_instance"></a> [instance](#output\_instance) | output instance repository |
77+
| <a name="output_name"></a> [name](#output\_name) | output name repository |
7778
| <a name="output_secrets"></a> [secrets](#output\_secrets) | output instance github actions secrets |
7879
<!-- END_TF_DOCS -->

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ locals {
2929
resource "github_repository" "this" {
3030
name = var.name
3131
description = var.description
32-
visibility = var.visibility
32+
#checkov:skip=CKV_GIT_1:The resource github is module
33+
visibility = var.visibility
3334

3435
homepage_url = local.settings.homepage_url
3536
has_issues = local.settings.has_issues

test/repository-basic-public/.terraform.lock.hcl

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!-- BEGIN_TF_DOCS -->
2+
## Requirements
3+
4+
| Name | Version |
5+
|------|---------|
6+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >=0.13.0 |
7+
| <a name="requirement_github"></a> [github](#requirement\_github) | >=4.5.0 |
8+
9+
## Providers
10+
11+
No providers.
12+
13+
## Modules
14+
15+
| Name | Source | Version |
16+
|------|--------|---------|
17+
| <a name="module_main"></a> [main](#module\_main) | ../.. | |
18+
19+
## Resources
20+
21+
No resources.
22+
23+
## Inputs
24+
25+
| Name | Description | Type | Default | Required |
26+
|------|-------------|------|---------|:--------:|
27+
| <a name="input_description"></a> [description](#input\_description) | description of repository. | `string` | n/a | yes |
28+
| <a name="input_name"></a> [name](#input\_name) | The name of the repository. | `string` | n/a | yes |
29+
| <a name="input_visibility"></a> [visibility](#input\_visibility) | type of visibility. | `string` | n/a | yes |
30+
31+
## Outputs
32+
33+
| Name | Description |
34+
|------|-------------|
35+
| <a name="output_instance"></a> [instance](#output\_instance) | show instance module |
36+
| <a name="output_repository_name"></a> [repository\_name](#output\_repository\_name) | show name repository |
37+
| <a name="output_secrets"></a> [secrets](#output\_secrets) | instance of the secrets. |
38+
<!-- END_TF_DOCS -->
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
# CREATE A SECRET FOR ORGANIZATION
3+
# This example will create a secrets for organization github.
4+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
6+
# ---------------------------------------------------------------------------------------------------------------------
7+
# TEST
8+
# We are creating a secrets with a single secret while specifying only the minimum required variables
9+
# ---------------------------------------------------------------------------------------------------------------------
10+
11+
module "main" {
12+
source = "../.."
13+
14+
name = var.name
15+
description = var.description
16+
visibility = var.visibility
17+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
output "instance" {
2+
description = "show instance module"
3+
value = module.main.instance
4+
}
5+
6+
output "repository_name" {
7+
description = "show name repository"
8+
value = module.main.name
9+
}
10+
11+
output "secrets" {
12+
description = "instance of the secrets."
13+
value = module.main.secrets
14+
}

test/repository-basic-public/provider.tf

Whitespace-only changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ---------------------------------------------------------------------------------------------------------------------
2+
# ENVIRONMENT VARIABLES
3+
# Define these secrets as environment variables.
4+
# ---------------------------------------------------------------------------------------------------------------------
5+
6+
# GITHUB_ORGANIZATION
7+
# GITHUB_TOKEN
8+
9+
# ---------------------------------------------------------------------------------------------------------------------
10+
# REQUIRED VARIABLES
11+
# These variables must be set when using this module.
12+
# ---------------------------------------------------------------------------------------------------------------------
13+
14+
# ---------------------------------------------------------------------------------------------------------------------
15+
# OPTIONAL VARIABLES
16+
# These variables have defaults, but may be overridden.
17+
# ---------------------------------------------------------------------------------------------------------------------
18+
19+
variable "visibility" {
20+
type = string
21+
description = "type of visibility."
22+
}
23+
24+
variable "name" {
25+
type = string
26+
description = "The name of the repository."
27+
}
28+
29+
variable "description" {
30+
type = string
31+
description = "description of repository."
32+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
terraform {
2+
required_version = ">=0.13.0"
3+
required_providers {
4+
5+
github = {
6+
source = "integrations/github"
7+
version = ">=4.5.0"
8+
}
9+
10+
}
11+
}

0 commit comments

Comments
 (0)