Skip to content

Commit

Permalink
feat: add release-please support (#80)
Browse files Browse the repository at this point in the history
* Update Terraform GitHub provider

* Add support for release-please
  • Loading branch information
sprankhub authored Sep 28, 2023
1 parent 6ad4631 commit 9cad3df
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
34 changes: 17 additions & 17 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ resource "github_repository" "repositories" {
}
}

resource "github_branch_protection" "repositories-release-please" {
for_each = { for key, value in var.repositories : key => value if try(value.release_please_branch, "") != "" }
repository_id = github_repository.repositories[each.key].node_id
pattern = each.value.release_please_branch

push_restrictions = [data.github_user.mage-os-ci.node_id]
force_push_bypassers = [data.github_user.mage-os-ci.node_id]
}

resource "github_branch_protection" "repositories" {
for_each = var.repositories
repository_id = github_repository.repositories[each.key].node_id
Expand Down
7 changes: 4 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ variable "repositories" {
}

github-actions = {
description = "Mage-OS GitHub Actions for the distribution repositories."
teams = ["infrastructure"]
topics = ["mage-os", "devops", "qa", "ecommerce", "ci", "actions", "magento2", "github-actions", "adobecommerce", "hacktoberfest"]
description = "Mage-OS GitHub Actions for the distribution repositories."
teams = ["infrastructure"]
topics = ["mage-os", "devops", "qa", "ecommerce", "ci", "actions", "magento2", "github-actions", "adobecommerce", "hacktoberfest"]
release_please_branch = "release-please--branches--main--components--github-actions"
}

infrastructure = {
Expand Down

0 comments on commit 9cad3df

Please sign in to comment.