Skip to content

Commit 8e68512

Browse files
authored
feat: upgrade github provider (#11)
1 parent 2746a6f commit 8e68512

File tree

10 files changed

+52
-46
lines changed

10 files changed

+52
-46
lines changed

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
terraform 1.1.7
1+
terraform 1.2.5

modules/membership/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ This module allows to manage GitHub memberships.
66

77
### Add memberships to an organization
88

9-
1. Create or find a GitHub Access Token.
9+
1. Create or find a GitHub Access Token and configure the GitHub provider.
10+
11+
```hcl
12+
provider "github" {
13+
token = var.github_token
14+
owner = "my-org-name"
15+
}
16+
```
17+
1018
2. Configure the module, for example:
1119
1220
```hcl

modules/membership/provider.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
provider "github" {
2-
version = "~> 2.9.1"
3-
token = var.github_token
4-
organization = var.github_organization
1+
terraform {
2+
required_version = ">= 1.2.0"
3+
required_providers {
4+
github = {
5+
source = "integrations/github"
6+
version = "~> 4.0"
7+
}
8+
}
59
}

modules/membership/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
variable "github_token" {
2-
type = string
3-
description = "The GitHub API token."
4-
}
5-
6-
variable "github_organization" {
7-
type = string
8-
description = "The GitHub Organization slug name."
9-
}
10-
111
variable "blocked_users" {
122
type = set(string)
133
default = []

modules/repository/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ This module allows to manage GitHub repositories.
66

77
### Create a repository
88

9-
1. Create or find a GitHub Access Token.
9+
1. Create or find a GitHub Access Token and configure the GitHub provider.
10+
11+
```hcl
12+
provider "github" {
13+
token = var.github_token
14+
owner = "my-org-name"
15+
}
16+
```
17+
1018
2. Create a team that will be added to the repository
1119
1220
```hcl

modules/repository/provider.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
provider "github" {
2-
version = "~> 2.9.1"
3-
token = var.github_token
4-
organization = var.github_organization
1+
terraform {
2+
required_version = ">= 1.2.0"
3+
required_providers {
4+
github = {
5+
source = "integrations/github"
6+
version = "~> 4.0"
7+
}
8+
}
59
}

modules/repository/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
variable "github_token" {
2-
type = string
3-
description = "The GitHub API token."
4-
}
5-
6-
variable "github_organization" {
7-
type = string
8-
description = "The GitHub Organization slug name."
9-
}
10-
111
variable "repository_name" {
122
type = string
133
description = "The repository name."

modules/team/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ This module allows to manage GitHub teams.
66

77
### Add a team to an organization
88

9-
1. Create or find a GitHub Access Token.
9+
1. Create or find a GitHub Access Token and configure the GitHub provider.
10+
11+
```hcl
12+
provider "github" {
13+
token = var.github_token
14+
owner = "my-org-name"
15+
}
16+
```
17+
1018
2. Configure the module, for example:
1119
1220
```hcl

modules/team/provider.tf

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
provider "github" {
2-
version = "~> 2.9.1"
3-
token = var.github_token
4-
organization = var.github_organization
1+
terraform {
2+
required_version = ">= 1.2.0"
3+
required_providers {
4+
github = {
5+
source = "integrations/github"
6+
version = "~> 4.0"
7+
}
8+
}
59
}

modules/team/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
variable "github_token" {
2-
type = string
3-
description = "The GitHub API token."
4-
}
5-
6-
variable "github_organization" {
7-
type = string
8-
description = "The GitHub Organization slug name."
9-
}
10-
111
variable "team_enable" {
122
type = bool
133
default = true

0 commit comments

Comments
 (0)