Skip to content

Commit

Permalink
feat: add deploy keys variable and implement GitHub Deploy Keys resource
Browse files Browse the repository at this point in the history
  • Loading branch information
arnol377 committed Mar 25, 2025
1 parent 3223952 commit 1c0e7be
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions github_deploy_keys.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This file implements GitHub Deploy Keys functionality for the repository

resource "github_repository_deploy_key" "deploy_key" {
for_each = { for k, v in var.deploy_keys : k => v }

title = each.value.title
repository = local.github_repo.name
key = each.value.key
read_only = each.value.read_only

depends_on = [
github_repository.repo
]
}
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -408,3 +408,13 @@ variable "github_pro_enabled" {
default = false
description = "Is this a Github Pro Account? If not, then it's limited in feature set"
}

variable "deploy_keys" {
description = "List of SSH deploy keys to add to the repository"
type = list(object({
title = string
key = string
read_only = optional(bool, true)
}))
default = []
}

0 comments on commit 1c0e7be

Please sign in to comment.