Skip to content

Commit 20b32a8

Browse files
refs platform/board#3920: check if membership exist
1 parent 798d7f4 commit 20b32a8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ resource "gitlab_project" "project" {
9191
namespace_id = var.operate_at_root_group_level ? data.gitlab_group.root_namespace.group_id : data.gitlab_group.parent_group[0].group_id
9292
}
9393

94+
data "gitlab_project_membership" "this" {
95+
project_id = local.project_id
96+
}
97+
9498
resource "gitlab_project_membership" "project" {
9599
count = var.autoassign_current_user_as_maintainer ? 1 : 0
96100
project = local.project_id

outputs.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,7 @@ output "gitlab_parent_group_auto_detected" {
4444
value = local.auto_detect_parent
4545
}
4646

47+
output "gitlab_project_memberships" {
48+
description = "List of current user memberships in the Gitlab project where the Gitlab Agents are installed."
49+
value = data.gitlab_project_membership.this.members
50+
}

0 commit comments

Comments
 (0)