Skip to content

Commit 90c8cd0

Browse files
authored
Merge pull request #24 from SPHTech-Platform/add/release-tags
add support for release tags as condition
2 parents 6ee6350 + 6684071 commit 90c8cd0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

github_action.tf

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ module "lambda_gha" {
1818

1919
default_conditions = var.default_conditions
2020

21-
conditions = length(var.github_repo.branches) != 0 ? [
21+
conditions = length(var.github_repo.branches) > 0 || length(var.github_repo.tags) > 0 ? [
2222
{
2323
test = "StringLike"
2424
variable = "token.actions.githubusercontent.com:sub"
25-
values = [for branch in var.github_repo.branches : "repo:${var.github_repo.repo}:ref:refs/heads/${branch}"]
26-
},
25+
values = compact(concat([for branch in var.github_repo.branches : "repo:${var.github_repo.repo}:ref:refs/heads/${branch}"], [for tag in var.github_repo.tags : "repo:${var.github_repo.repo}:ref:refs/tags/${tag}"]))
26+
}
2727
] : []
2828
}
2929

variables.tf

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ variable "github_repo" {
5555
repo = string
5656
branches = optional(list(string), [])
5757
environments = optional(list(string), ["*"])
58+
tags = optional(list(string), [])
5859

5960
# Custom Role name. It will autocreate based on repo if not provided
6061
role_name = optional(string)

0 commit comments

Comments
 (0)