For the complete documentation index, see llms.txt. This page is also available as Markdown.

Overview

Overview of the code repository connectors Harness supports and where to set up each one.

Harness code repository connectors connect your Harness account to your Git SCM (Source Code Management) provider. Pipelines use these connectors to pull code and other important files, such as Helm charts, Kubernetes manifests, and Terraform scripts, from your Git repositories.

You add a code repository connector once, then reuse it across pipelines and other Harness resources in the same account, organization, or project. Harness supports platform-specific connectors for popular Git providers, such as GitHub, GitLab, Bitbucket, and Azure Repos, as well as a platform-agnostic Git connector for any provider that exposes a standard Git endpoint.


What you will learn from this topic


Available connectors

For instructions on connecting to a specific code repository, see:


Connector scopes

You can add a code repository connector at the account, org, or project scope. Each connector page explains the steps at the project scope. The process is the same for org and account scope, starting from the corresponding Connectors page.


Git provider account permissions

When you create a code repo connector, you provide credentials for authentication and authorization, such as a username and password, a personal access token, or another authentication method. The credentials let the connector take actions in your Git provider, such as cloning repositories or reading pull request information. The credentials you provide must have the permissions necessary for the actions the connector will perform.

The account or token you use must have the same permissions that an equivalent user account needs to perform the same actions. For example:

  • If the connector needs to clone repositories, the credentials must allow reading and cloning repositories.

  • If the connector needs to pull manifests from a repo, the credentials must have read repo (or equivalent) permissions in your Git provider.

Personal access token permissions

When you create a personal access token, the account you use to create the token must have the required permissions or higher, such as repo admin. Some connectors require an account with higher permissions, such as an admin account. Go to the connector setup instructions for the exact permissions required by your provider.

For permissions related to the Harness Git Experience, go to Source Code Manager settings.


SSH key authentication

If a code repo connector uses SSH key authentication, the SSH key is stored as a Harness SSH credential secret. The SSH credential's Username must be git.


Troubleshooting

You might encounter these issues with code repo connectors. Additional connector-specific issues are described on the dedicated pages for each connector.

Network connection times out when fetching large repos

Harness performs a git clone to fetch files. When fetching very large repositories, the network connection can time out. With fetch optimization enabled, Harness uses provider-specific APIs to improve performance when fetching very large repos.

Currently, the fetch optimization feature is behind the setting Fetch files from Git using provider-specific APIs, under the Continuous Deployment section.

If this setting is enabled, and your GitHub organization has SAML enabled, the token must be SAML-authorized to access the organization, even if the repository is public. Go to the GitHub documentation on GitHub authentication with SAML single sign-on to authorize your token for SAML single sign-on.

Pipeline status updates are not sent to PRs

Harness uses the pipeline's codebase connector to send status updates to PRs in your Git provider. Check the pipeline's codebase configuration to confirm that it has a default codebase configuration and that it is using the correct code repo connector.

Connection tests fail due to network restrictions

If your connector connection tests (preflight checks) fail due to network restrictions, split DNS configurations, proxy setups, or restrictive firewall policies, but you know the connector will work at runtime, you can configure Harness to skip the connection validation.

To skip connector preflight checks, you need both:

  1. Account-level feature flag enabled: Contact Harness Support to enable the CI_IGNORE_TEST_CONNECTION feature flag for your account.

  2. Connector YAML configuration: Add ignoreTestConnection: true to your connector's YAML configuration.

When both the feature flag and YAML property are enabled, connection tests always return as "Successful" without performing actual connectivity validation.

Go to Create a connector using YAML to see an example configuration.

Use this feature carefully. Skipping connection tests means Harness does not validate whether the connector credentials are correct or if the remote service is accessible. Only use this when you are certain the connector will work at runtime despite failing preflight checks.


Next steps

Last updated

Was this helpful?