Skip to main content
The Repository CRD is the representation of a Git repository from a Git provider platform. It defines how Pipelines as Code connects to your repository and manages pipeline execution.

Overview

The Repository resource is namespaced and can be referenced using the short name repo.
apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
  name: my-repository
  namespace: my-namespace
spec:
  url: "https://github.com/owner/repo"
  git_provider:
    type: github
    secret:
      name: github-token
      key: token

Resource Structure

apiVersion
string
required
API version for the Repository resource. Must be pipelinesascode.tekton.dev/v1alpha1.
kind
string
required
Resource kind. Must be Repository.
metadata
ObjectMeta
required
Standard Kubernetes metadata including name, namespace, labels, and annotations.
spec
RepositorySpec
required
Specification of the desired behavior of the repository. See Repository Spec for detailed field documentation.
pipelinerun_status
[]RepositoryRunStatus
Status information for pipeline runs executed for this repository. See Repository Status for detailed field documentation.

Resource Shortcuts

The Repository CRD supports the following shortname:
  • repo - Short form for repository
# List all repositories
kubectl get repo

# Describe a specific repository
kubectl describe repo my-repository

Custom Columns

When listing repositories with kubectl get repo, the following columns are displayed:
  • URL - The Git repository URL
  • Succeeded - Success status of the last PipelineRun
  • Reason - Reason for the last PipelineRun status
  • StartTime - When the last PipelineRun started
  • CompletionTime - When the last PipelineRun completed

Complete Example

apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
  name: example-repo
  namespace: pipelines-as-code
  labels:
    app: my-app
spec:
  url: "https://github.com/organization/repository"
  concurrency_limit: 5
  git_provider:
    type: github
    url: "https://github.com"
    user: "pac-bot"
    secret:
      name: github-app-secret
      key: github-app-token
    webhook_secret:
      name: webhook-secret
      key: webhook-token
  settings:
    pipelinerun_provenance: "source"
    policy:
      ok_to_test:
        - "trusted-user"
        - "maintainer"
      pull_request:
        - "contributor"
    github:
      comment_strategy: "update"

Build docs developers (and LLMs) love