On this page
Repository Spec
This page documents every field available under the Repository CR spec. Use this reference when configuring a Repository CR for your Git repository. The spec defines the desired state of a Repository, including its URL, Git provider configuration, and operational settings.
Fields
Specifies the repository URL. Must be a valid HTTP/HTTPS Git repository URL. Pipelines-as-Code uses this URL to clone the repository and fetch pipeline definitions from the .tekton/ directory.
spec:
url: "https://github.com/owner/repository"Sets the maximum number of concurrent PipelineRuns for this repository. This prevents resource exhaustion when many events trigger pipelines simultaneously. Minimum value: 1.
spec:
concurrency_limit: 5Configures how Pipelines-as-Code connects to your Git provider. Contains authentication credentials, API endpoints, and provider type information.
Show GitProvider Fields
Identifies the Git provider type. Pipelines-as-Code uses this to select the correct API and authentication flow. Supported values:
github- GitHub.com or GitHub Enterprisegitlab- GitLab.com or self-hosted GitLabbitbucket-datacenter- Bitbucket Data Center (self-hosted)bitbucket-cloud- Bitbucket Cloud (bitbucket.org)forgejo- Forgejo instancesgitea- Gitea instances (alias for forgejo, kept for backwards compatibility)
git_provider:
type: githubSpecifies the Git provider API endpoint. Pipelines-as-Code sends API requests to this base URL (for example, https://api.github.com for GitHub or a custom GitLab instance URL).
git_provider:
url: "https://gitlab.example.com"Sets the username for basic auth or token-based authentication. Pipelines-as-Code does not use this field for GitHub App authentication.
git_provider:
user: "pac-bot"References a Kubernetes Secret containing the credentials (token, password, or private key) that Pipelines-as-Code uses to authenticate with the Git provider API.
Show Secret Fields
git_provider:
secret:
name: github-token
key: tokenReferences a Kubernetes Secret containing the shared secret that Pipelines-as-Code uses to validate that incoming webhooks are legitimate and originate from the Git provider.
git_provider:
webhook_secret:
name: webhook-secret
key: secretspec:
git_provider:
type: github
url: "https://github.com"
user: "pac-bot"
secret:
name: github-token
key: tokenConfigures incoming webhooks. Each entry specifies how Pipelines-as-Code handles external webhook requests that do not come from the primary Git provider.
Show Incoming Fields
webhook-url is supported, which allows external systems to trigger PipelineRuns via generic HTTP requests.References the Kubernetes Secret that Pipelines-as-Code uses to authenticate incoming webhook requests. Only requests with the matching secret value are accepted.
spec:
incoming:
- type: webhook-url
secret:
name: webhook-secret
key: token
params:
- branch
- revision
targets:
- main
- developDefines repository-level parameters that you can reference in PipelineRuns. Use these for default values or event-specific configuration.
Show Params Fields
{{ name }} syntax.secret_ref.References a Kubernetes Secret containing the parameter value. Use this when the parameter contains sensitive information that you should not store directly in the Repository CR. This field is mutually exclusive with value.
spec:
params:
- name: deployment_env
value: production
filter: "event == 'push' && target_branch == 'main'"
- name: api_key
secret_ref:
name: api-credentials
key: keyConfigures repository-level settings, including authorization policies, provider-specific behavior, and provenance settings. See Settings Reference for detailed documentation.
spec:
settings:
pipelinerun_provenance: "source"
policy:
ok_to_test:
- "trusted-user"Complete example
spec:
url: "https://github.com/organization/repository"
concurrency_limit: 3
git_provider:
type: github
url: "https://github.com"
user: "pac-bot"
secret:
name: github-token
key: token
webhook_secret:
name: webhook-secret
key: secret
incoming:
- type: webhook-url
secret:
name: incoming-webhook-secret
key: token
params:
- version
- environment
targets:
- main
params:
- name: cluster_name
value: "production-cluster"
- name: registry_token
secret_ref:
name: registry-credentials
key: token
filter: "event == 'push'"
settings:
pipelinerun_provenance: "source"
policy:
ok_to_test:
- "maintainer-user"
- "trusted-contributor"
pull_request:
- "external-contributor"
github:
comment_strategy: "update"