Overview
Incoming webhooks allow you to trigger PipelineRuns in Pipelines-as-Code using a shared secret and HTTP request, without requiring a new code iteration or Git event. This enables integration with external systems, CI/CD tools, or custom automation workflows.Incoming webhooks trigger PipelineRuns from your
.tekton directory, just like Git events. The webhook specifies which branch’s pipeline definitions to use.How It Works
- Configure incoming webhook in your Repository CR with a secret and target branches
- Create PipelineRuns with
on-event: [incoming]annotation - External systems make HTTP POST requests to the PAC controller with the secret
- PAC validates the request and triggers matching PipelineRuns
Configuration
Repository CR Setup
Define incoming webhooks in thespec.incoming field:
Type of incoming webhook. Currently only
webhook-url is supported.List of target branches that this webhook can trigger. Supports exact matches and glob patterns.
List of parameter names to extract from the webhook payload. These will be available in your PipelineRuns.
Secret Configuration
Create a Kubernetes Secret containing the shared secret:PipelineRun Configuration
Annotate your PipelineRun to respond to incoming webhooks:Triggering Webhooks
Required Parameters
Name of the Repository CR.
Namespace containing the Repository CR. Required when the repository name is not unique across the cluster.
Target branch configured in the incoming webhook.
Name or generateName of the PipelineRun to trigger. Must match a PipelineRun definition in the
.tekton directory.The shared secret value from the Kubernetes Secret referenced in the Repository CR.
JSON object containing parameter values to override in the PipelineRun context.
Making Requests
Recommended: Use the POST JSON body method for security. URL query parameters are deprecated and expose secrets in logs.
POST JSON Body (Recommended)
URL Query Parameters (Deprecated)
Branch Targeting with Glob Patterns
Thetargets field supports both exact string matching and glob patterns:
Glob Pattern Syntax
*- Matches any characters (zero or more)?- Matches exactly one character[abc]- Matches one character: a, b, or c[a-z]- Matches one character in range a to z[0-9]- Matches one digit{a,b,c}- Matches any of the alternatives (alternation)
Examples
Feature Branches
Feature Branches
Semantic Versioning Tags
Semantic Versioning Tags
Multiple Patterns with Alternation
Multiple Patterns with Alternation
First-Match-Wins
When multiple incoming webhook configurations match the same branch, the first matching webhook in YAML order is used:Place production or sensitive webhooks first in the list to ensure they take precedence.
Passing Dynamic Parameters
You can pass dynamic parameter values to override Pipelines-as-Code built-in parameters:Repository CR Configuration
List the parameters you want to accept from webhook payloads:Sending Parameters in Webhook Request
Using Parameters in PipelineRun
Parameters must be listed in the
params field of the incoming webhook configuration, otherwise they will be ignored.Git Provider Integration
GitHub App
GitHub App authentication works automatically with incoming webhooks:GitHub Enterprise
For GitHub Enterprise, include theX-GitHub-Enterprise-Host header:
Webhook-Based Providers
For GitLab, Bitbucket, Gitea/Forgejo, you must specify thegit_provider section:
Supported
git_provider.type values: github, gitlab, bitbucket-cloud, bitbucket-datacenter, gitea, forgejoStatus and Notifications
When triggered via incoming webhook, the PipelineRun is treated as a push event:- Status is reported back to the Git provider
- Check runs/commit statuses are created
- Comments may be posted (depending on configuration)
Viewing Status
Use thetkn pac CLI to inspect Repository status:
Security Considerations
Secret Rotation
To rotate secrets:- Create a new secret with a different name:
- Update Repository CR to reference new secret:
- Update all webhook callers with new secret
- Delete old secret after migration
Use Cases
Manual Deployment Trigger
Manual Deployment Trigger
Integration with External CI/CD
Integration with External CI/CD
Scheduled Jobs via Cron
Scheduled Jobs via Cron
Webhook Relay Service
Webhook Relay Service
Troubleshooting
403 Forbidden / Authentication Failed
403 Forbidden / Authentication Failed
- Verify the secret value matches exactly (no trailing whitespace)
- Check that the Secret exists in the correct namespace
- Ensure the
secret.keyfield matches the key in your Secret (defaults tosecret) - Verify the Repository CR name and namespace are correct
No PipelineRun Triggered
No PipelineRun Triggered
- Confirm the branch matches one of the
targetspatterns - Check that a PipelineRun with
on-event: [incoming]exists in the.tektondirectory - Verify the PipelineRun name/generateName matches the request
- Check the
on-target-branchannotation matches the branch
Parameters Not Available
Parameters Not Available
- Ensure parameters are listed in the
paramsfield of the incoming webhook configuration - Verify the parameter names match exactly (case-sensitive)
- Check that you’re using the JSON body method with
Content-Type: application/json
Multiple PipelineRuns Triggered
Multiple PipelineRuns Triggered
- This is expected if multiple PipelineRuns match the event and branch
- Use more specific
on-target-branchpatterns to control which runs trigger - Consider using different branches or webhook configurations for different pipelines
Best Practices
- Use Strong Secrets: Generate cryptographically random secrets with at least 32 characters
- Separate Environments: Use different secrets for dev, staging, and production
- Limit Scope: Configure specific branch patterns rather than wildcards when possible
- Monitor Usage: Log incoming webhook requests for audit purposes
- Test First: Use a test repository to validate webhook configuration before production
- Document Webhooks: Maintain documentation of all systems that trigger webhooks
- Use JSON Body: Always use the POST JSON body method, never URL parameters
- Implement Retries: Add retry logic in webhook callers for reliability
See Also
- Custom Parameters - Using dynamic parameters
- Authoring PipelineRuns - PipelineRun configuration
- Repository CRD - Complete Repository CR reference
- Statuses - Status reporting and notifications