Skip to main content
The spec field defines the desired state of a Repository, including its URL, Git provider configuration, and operational settings.

Fields

url
string
required
URL of the repository. Must be a valid HTTP/HTTPS Git repository URL that Pipelines as Code will use to clone and fetch pipeline definitions from.
spec:
  url: "https://github.com/owner/repository"
concurrency_limit
integer
Maximum number of concurrent PipelineRuns that can run for this repository. This helps prevent resource exhaustion when many events trigger pipelines simultaneously.Minimum value: 1
spec:
  concurrency_limit: 5
git_provider
GitProvider
Git provider details specific to configuration. Contains authentication, API endpoints, and provider type information needed to interact with the Git service.
spec:
  git_provider:
    type: github
    url: "https://github.com"
    user: "pac-bot"
    secret:
      name: github-token
      key: token
incoming
[]Incoming
Incoming webhook configurations. Each configuration specifies how to handle external webhook requests that don’t come directly from the primary Git provider.
spec:
  incoming:
    - type: webhook-url
      secret:
        name: webhook-secret
        key: token
      params:
        - branch
        - revision
      targets:
        - main
        - develop
params
[]Params
Repository level parameters that can be referenced in PipelineRuns. These parameters can be used as default values or configured for specific events.
spec:
  params:
    - name: deployment_env
      value: production
      filter: "event == 'push' && target_branch == 'main'"
    - name: api_key
      secret_ref:
        name: api-credentials
        key: key
settings
Settings
Configuration settings for the repository, including authorization policies, provider-specific configuration, 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"

Build docs developers (and LLMs) love