Skip to content

Commit 3f596e0

Browse files
milldrgoruha
andauthored
feat: Support for GitHub Apps (#17)
* support for github apps * support for github apps * changelong --------- Co-authored-by: Igor Rodionov <[email protected]>
1 parent 3d16f37 commit 3f596e0

File tree

8 files changed

+33
-13
lines changed

8 files changed

+33
-13
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,5 @@ github/
7474
*.ovpn
7575

7676
*.zip
77+
78+
**/account-map

src/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## `argocd-github-repo` Component PR [#17](https://github.com/cloudposse-terraform-components/aws-argocd-github-repo/pull/17)
2+
3+
Corrected the spelling of "succeded" to "succeeded" in the `on-deploy-succeded` notification. As a result, both components (`argocd-github-repo` and `eks/argocd`) need to be updated to make this change.
4+
5+
See the [PR for eks/argocd](https://github.com/cloudposse-terraform-components/aws-eks-argocd/pull/16)
6+
17
## Components PR [#851](https://github.com/cloudposse/terraform-aws-components/pull/851)
28

39
This is a bug fix and feature enhancement update. There are few actions necessary to upgrade.

src/README.md

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/context.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ variable "descriptor_formats" {
264264
Describe additional descriptors to be output in the `descriptors` output map.
265265
Map of maps. Keys are names of descriptors. Values are maps of the form
266266
`{
267-
format = string
268-
labels = list(string)
267+
format = string
268+
labels = list(string)
269269
}`
270270
(Type is `any` so the map values can later be enhanced to provide additional options.)
271271
`format` is a Terraform format string to be passed to the `format()` function.

src/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ resource "github_branch_protection" "default" {
8585
dismiss_stale_reviews = true
8686
restrict_dismissals = true
8787
require_code_owner_reviews = true
88+
pull_request_bypassers = var.bypass_pull_request_actors
8889
}
8990
}
9091

src/provider-github.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
locals {
2-
github_token = local.enabled ? coalesce(var.github_token_override, data.aws_ssm_parameter.github_api_key[0].value) : ""
2+
github_token = local.enabled ? (
3+
var.use_local_github_credentials ? null : coalesce(var.github_token_override, data.aws_ssm_parameter.github_api_key[0].value)
4+
) : ""
35
}
46

57
data "aws_ssm_parameter" "github_api_key" {
6-
count = local.enabled ? 1 : 0
8+
count = local.enabled && !var.use_local_github_credentials ? 1 : 0
79
name = var.ssm_github_api_key
810
with_decryption = true
911
}

src/variables.tf

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ variable "github_notifications" {
180180
default = [
181181
"notifications.argoproj.io/subscribe.on-deploy-started.app-repo-github-commit-status: \"\"",
182182
"notifications.argoproj.io/subscribe.on-deploy-started.argocd-repo-github-commit-status: \"\"",
183-
"notifications.argoproj.io/subscribe.on-deploy-succeded.app-repo-github-commit-status: \"\"",
184-
"notifications.argoproj.io/subscribe.on-deploy-succeded.argocd-repo-github-commit-status: \"\"",
183+
"notifications.argoproj.io/subscribe.on-deploy-succeeded.app-repo-github-commit-status: \"\"",
184+
"notifications.argoproj.io/subscribe.on-deploy-succeeded.argocd-repo-github-commit-status: \"\"",
185185
"notifications.argoproj.io/subscribe.on-deploy-failed.app-repo-github-commit-status: \"\"",
186186
"notifications.argoproj.io/subscribe.on-deploy-failed.argocd-repo-github-commit-status: \"\"",
187187
]
@@ -197,3 +197,15 @@ variable "web_commit_signoff_required" {
197197
description = "Require contributors to sign off on web-based commits"
198198
default = false
199199
}
200+
201+
variable "bypass_pull_request_actors" {
202+
type = list(string)
203+
description = "List of GitHub usernames and team slugs that can bypass pull request requirements"
204+
default = []
205+
}
206+
207+
variable "use_local_github_credentials" {
208+
type = bool
209+
description = "Use local GitHub credentials from environment variables instead of SSM"
210+
default = false
211+
}

src/versions.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,5 @@ terraform {
1414
source = "hashicorp/tls"
1515
version = ">= 3.0"
1616
}
17-
random = {
18-
source = "hashicorp/random"
19-
version = ">= 2.3"
20-
}
2117
}
2218
}

0 commit comments

Comments
 (0)