Global repository settings is a Technology Preview feature.
Overview
Global repository settings allow you to:- Define default configurations for all repositories
- Set organization-wide policies and limits
- Configure shared Git provider authentication
- Establish custom parameters available to all repositories
Creating a Global Repository
The global repository must be created in the namespace where the Pipelines as Code controller is installed (typicallypipelines-as-code or openshift-pipelines).
Default Global Repository Name
By default, the global repository CR must be namedpipelines-as-code. You can customize this by setting the PAC_CONTROLLER_GLOBAL_REPOSITORY environment variable in the controller and watcher deployments.
Repository URL
The global repository CR does not need a validspec.url field. You can either:
- Leave it blank
- Set it to a placeholder like
https://pac.global.repo
Supported Settings
The following settings can be configured in the global repository:Maximum number of concurrent PipelineRuns allowed per repository.
Custom parameters available to all repositories. Individual repositories can override these or define their own.
Git provider authentication settings including:
type- Provider type (github, gitlab, forgejo, bitbucket-cloud, bitbucket-datacenter)secret- Reference to authentication secretwebhook_secret- Reference to webhook secreturl- Provider URL (for self-hosted instances)user- API username
Repository policies and settings:
- PipelineRun definition provenance
- GitHub App token scope settings
- Incoming webhook rules
Global settings only apply when running via Git provider events. They are not applied when using the
tkn pac CLI directly.Example Configuration
Basic Global Repository
Global Repository with Git Provider Settings
For webhook-based Git providers, you can configure global authentication:How Global Settings Are Applied
Global settings follow these precedence rules:- Local repository settings always win - If a setting is defined in the namespace repository, it overrides the global setting
- Global settings provide defaults - If a setting is not defined locally, the global value is used
- Settings are merged - Some settings like custom parameters are combined from both sources
Example: Setting Precedence
Consider a local repository in theuser-namespace:
concurrency_limit=2(from local repository)params.custom="value"(from global repository)- Git provider settings (secret, webhook_secret) are taken from global repository because the local repository has matching
type: gitlab
Supported Git Provider Types
When configuringgit_provider.type for global settings, use these values:
GitHub with webhook authentication (not GitHub App)
GitLab (SaaS or self-hosted)
Forgejo or Gitea instances
Alias for forgejo (kept for backwards compatibility)
Bitbucket Cloud (bitbucket.org)
Bitbucket Server/Data Center (self-hosted)
Git Provider Authentication
When using global Git provider settings:- Local repository must specify matching type - The
git_provider.typein the local repository must match the global repository type - Secrets are fetched from global namespace - Authentication secrets referenced in the global repository are fetched from the global repository’s namespace
- All repositories share credentials - All repositories matching the provider type use the same authentication credentials
Creating Provider Secrets
Secrets must be created in the same namespace as the global repository:Use Cases
Organization-Wide Concurrency Limits
Prevent resource exhaustion by setting default concurrency limits:Shared Custom Parameters
Provide common parameters for all repositories:Centralized Git Provider Configuration
Manage Git provider credentials centrally:Customizing Global Repository Name
To use a different name for the global repository:- Set the environment variable in the controller deployment:
- Set the environment variable in the watcher deployment:
- Create the Repository CR with your custom name:
Verification
To verify that global settings are being applied:- Check the global repository exists:
- Review controller logs for global repository processing:
- Test with a repository that doesn’t override global settings and verify the expected behavior
See Also
- Repository CRD Reference - Complete Repository CR specification
- Configuration - ConfigMap settings
- Policy - Repository access policies