tkn pac webhook
Manage webhook configuration for Pipelines-as-Code repositories including secrets and provider tokens.Available Commands
add- Add webhook secret and configure on Git providerupdate-token- Update provider token in existing secret
add
Add a new webhook secret for a Git provider and configure it on the provider settings.Synopsis
Description
Thewebhook add command:
- Selects a repository (prompts if not specified)
- Detects Git provider (GitHub, GitLab, Bitbucket, etc.)
- Prompts for credentials (personal access token, webhook secret)
- Creates Kubernetes secrets for authentication
- Configures webhook on the Git provider
- Updates Repository CRD with secret references
- Repositories not using GitHub App
- Adding webhooks to existing repositories
- Reconfiguring webhook secrets
If using GitHub App, webhook configuration is automatic. This command is not needed.
Usage Examples
Arguments
Repository name (optional - prompts if not provided)
Flags
Namespace containing the repository
Namespace where Pipelines-as-Code is installed
Interactive Flow
1. Repository Selection
If not specified:2. Provider Detection
Automatically detected from repository URL:3. Personal Access Token
4. Webhook Secret
5. Webhook Configuration
Output Example
Provider-Specific Requirements
GitHub
Token Scopes Required:repo- Full control of private repositoriesadmin:repo_hook- Write access to repository hooks
- Go to Settings â Developer settings â Personal access tokens
- Generate new token (classic)
- Select required scopes
- Copy token
GitLab
Token Scopes Required:api- Full API accessread_repository- Read repository
- Go to Preferences â Access Tokens
- Create personal access token
- Select required scopes
- Copy token
Bitbucket Cloud
App Password Required:repository:write- Write access to repositorieswebhook- Manage webhooks
- Go to Personal settings â App passwords
- Create app password
- Select required permissions
- Copy password
Bitbucket Server/Data Center
Token Required:REPO_ADMIN- Repository administration
- Go to Personal settings â Personal access tokens
- Create token with REPO_ADMIN
- Copy token
Created Secrets
Two Kubernetes secrets are created:git-provider-secret
webhook-secret
Repository CRD Update
The Repository is updated with secret references:Webhook Configuration on Provider
The webhook is configured with: Payload URL:- Push
- Pull Request
- Issue Comment (for
/test,/retestcommands)
Troubleshooting
GitHub App Already Configured:- Verify repository URL is correct
- Ensure token has access to the repository
- Check repository visibility (private vs public)
update-token
Update the provider token in an existing webhook secret.Synopsis
Description
Theupdate-token command updates the personal access token or API key in an existing Git provider secret. This is useful when:
- Token has expired
- Token was rotated for security
- Need to use a different account
- Changing token scopes
This command only updates the token, not the webhook configuration. The webhook on the Git provider remains unchanged.
Usage Examples
Arguments
Repository name (optional - prompts if not provided)
Flags
Namespace containing the repository
Interactive Flow
1. Repository Selection
2. Token Input
3. Confirmation
Output Example
When to Update Token
-
Token Expired
-
Token Revoked
-
Security Rotation
- Regular security practice
- After team member leaves
- Suspected compromise
-
Scope Changes
- Need additional permissions
- Reduce token privileges
Common Workflows
Rotate Expired Token
Update Multiple Repositories
Security Incident Response
Troubleshooting
Webhook Not Configured:tkn pac webhook add first to configure webhook.
GitHub App Configured:
tkn pac webhook add to configure properly.
Secret Not Found:
tkn pac webhook add to recreate.
Permission Denied:
Verification
After updating token, verify it works:Related Commands
tkn pac create repo- Create repository with webhooktkn pac bootstrap- Bootstrap with GitHub Apptkn pac list- List repositories