connect_gitops_repository
Connect a GitOps repository to a cluster that has none: bind an existing GitHub credential plus a repository and branch - the same binding the portal's GitOps step creates. Pick the credential from list_gitops_credentials (pass credential_id, or credential_name when unambiguous) and the repository from list_gitops_repositories: it must be in the credential's synced repository list. On confirm the binding is written to the cluster's resource graph, a repository webhook is provisioned best-effort, the current cluster state is pushed to the repository as an initial commit, and a sync is nudged so the repository and the cluster record converge. Refused when the cluster is already connected to a DIFFERENT GitOps source: repointing prunes everything the new source does not define, so it stays on the cluster settings flow with its explicit acknowledgements. Re-connecting the identical repository and branch is safe and just refreshes the binding.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | Yes | The branch the cluster's GitOps state lives on, e.g. main. | |
| cluster_id | No | Cluster UUID. Optional when the chat is already scoped to a cluster. | |
| repository | Yes | The repository's full name in owner/name form, e.g. ankraio/values. | |
| credential_id | No | UUID of the GitHub credential from list_gitops_credentials. Preferred over credential_name. | |
| credential_name | No | Name of the GitHub credential; refused when more than one credential shares the name. |