File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments