Skip to content

Commit

Permalink
CCL-509 added git_branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mynampatinaveen committed Aug 29, 2024
1 parent 2802a28 commit 6da3bb2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/products/static-site/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ resource "aws_iam_role" "static_site_actions_push" {
}
Condition = {
StringLike = {
"token.actions.githubusercontent.com:sub" : "repo:${var.tenant_vars.repository}:*"
"token.actions.githubusercontent.com:sub" : "repo:${var.tenant_vars.repository}:${var.tenant_vars.gitbranch}"
"sts:RoleSessionName" : "GitHubActions"
}
StringEquals = {
Expand Down
10 changes: 10 additions & 0 deletions modules/products/static-site/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,13 @@ variable "cloud_front_default_vars" {
variable "aws_region" {
type = string
}

variable "git_branch" {
type = string
description = "git branches which can push to S3 from "

validation {
condition = contains(var.git_branch, "main") || contains(var.git_branch, "master") || contains(var.git_branch, "CCL-509")
error_message = "valid push branches are [main,master,CCL-509]"
}
}

0 comments on commit 6da3bb2

Please sign in to comment.