diff --git a/share/gitea-tekton-org/gitea_hook.tf b/share/gitea-tekton-org/gitea_hook.tf index 473213b..6b83b13 100644 --- a/share/gitea-tekton-org/gitea_hook.tf +++ b/share/gitea-tekton-org/gitea_hook.tf @@ -47,9 +47,14 @@ resource "restapi_object" "gitea_org_hook" { resource "restapi_object" "ci-token" { path = "/users/org-${var.organization}-ci/tokens" create_method = "POST" + read_path = "/users/org-${var.organization}-ci/tokens" + read_search = { + search_key = "name" + search_value = "tekton-${var.organization}" + } id_attribute = "name" data = jsonencode({ - name = "tekton-${var.organization}-${var.instance}-${var.component}-${var.namespace}" + name = "tekton-${var.organization}" scopes = [ "write:repository" ]