Skip to main content
The settings field in the Repository spec contains configuration settings for the repository, including authorization policies, provider-specific configuration, and provenance settings.

Settings Fields

pipelinerun_provenance
string
Configures how PipelineRun definitions are fetched.Options:
  • source - Fetch definitions from the event source branch/SHA (default)
  • default_branch - Fetch definitions from the repository default branch
settings:
  pipelinerun_provenance: "source"
github_app_token_scope_repos
[]string
Lists repositories that can access the GitHub App token when using the GitHub App authentication method. This allows specific repositories to use tokens generated for the GitHub App installation, useful for cross-repository access.
settings:
  github_app_token_scope_repos:
    - "organization/shared-library"
    - "organization/common-tasks"
policy
Policy
Defines authorization policies for the repository, controlling who can trigger PipelineRuns under different conditions.
settings:
  policy:
    ok_to_test:
      - "team-lead"
      - "senior-dev"
    pull_request:
      - "trusted-external"

Provider-Specific Settings

GitHub Settings

github
GithubSettings
GitHub-specific settings for repositories hosted on GitHub.

GitLab Settings

gitlab
GitlabSettings
GitLab-specific settings for repositories hosted on GitLab.

Forgejo/Gitea Settings

forgejo
ForgejoSettings
Forgejo/Gitea-specific settings for repositories hosted on Forgejo or Gitea.

AI Analysis Settings

ai
AIAnalysisConfig
AI/LLM analysis configuration for automated CI/CD pipeline analysis.

Complete Example

apiVersion: pipelinesascode.tekton.dev/v1alpha1
kind: Repository
metadata:
  name: example-repo
  namespace: pipelines-as-code
spec:
  url: "https://github.com/organization/repository"
  settings:
    # Provenance configuration
    pipelinerun_provenance: "source"
    
    # GitHub App token scoping
    github_app_token_scope_repos:
      - "organization/shared-tasks"
      - "organization/common-library"
    
    # Authorization policies
    policy:
      ok_to_test:
        - "team-lead"
        - "senior-engineer"
        - "trusted-maintainer"
      pull_request:
        - "approved-contributor"
    
    # GitHub-specific settings
    github:
      comment_strategy: "update"
    
    # AI analysis configuration
    ai:
      enabled: true
      provider: "openai"
      api_url: "https://api.openai.com/v1"
      secret_ref:
        name: openai-credentials
        key: api-key
      timeout_seconds: 45
      max_tokens: 1500
      roles:
        - name: "pr-failure-analysis"
          prompt: |
            You are a CI/CD expert. Analyze the following pipeline failure and provide:
            1. Root cause analysis
            2. Specific fix recommendations
            3. Prevention strategies
          model: "gpt-4"
          on_cel: 'event_type == "pull_request" && status == "failed"'
          output: "pr-comment"
          context_items:
            commit_content: true
            pr_content: true
            error_content: true
            container_logs:
              enabled: true
              max_lines: 100
        - name: "security-review"
          prompt: "Review this change for potential security issues"
          model: "gpt-4"
          on_cel: 'event_type == "pull_request" && has_label("security-review")'
          context_items:
            commit_content: true
            pr_content: true

Settings Inheritance

Settings can be defined at both the global level (in the ConfigMap) and the repository level (in the Repository CR). Repository-level settings override global settings when both are present.

Build docs developers (and LLMs) love