Overview
Pipelines-as-Code automatically executes PipelineRuns when Git events occur (pushes, pull requests). This guide covers authorization, execution monitoring, error handling, and lifecycle management.How Execution Works
PipelineRuns with matching annotations are selected (see Event Matching).
PipelineRuns are fetched from the source branch by default. Configure
pipelinerun_provenance: "default_branch" in the Repository CR to always use the default branch.ACL Permissions
Only authorized users can trigger PipelineRuns. A user is authorized if they are:- Repository-based
- OWNERS file
- OWNERS_ALIASES
- Repository CR Policy
- Repository owner
- Repository collaborator
- Organization member (public or private)
- Has push permissions to the repository
Unauthorized Users
When an unauthorized user opens a PR, PAC:- Posts a
Pendingstatus check - Comments that the user lacks permissions
- Waits for an authorized user to comment
/ok-to-test
GitHub bot users (detected via the GitHub API) are silently ignored unless explicitly authorized.
/ok-to-test Command
Authorized users can approve external PRs:
SHA Validation (GitHub only)
Cluster administrators can require SHA validation for/ok-to-test:
Draft Pull Requests (GitHub)
By default, PAC runs on draft PRs. To skip drafts:Monitoring Execution
Using tkn pac CLI
View logs for the latest PipelineRun:Using Tekton Dashboard
If the Tekton Dashboard is installed, PAC posts a direct link in the GitHub Checks tab.Using OpenShift Console
On OpenShift, PAC links to the Pipeline view in the Console.Git Provider UI
- GitHub
- GitLab
- Forgejo/Gitea
Check the Checks tab on pull requests:
Each PipelineRun appears as a separate check with:
Each PipelineRun appears as a separate check with:- Status (pending, success, failure)
- Task-by-task results
- Log snippets
- Execution time
Error Handling
YAML Parsing Errors
If PAC encounters invalid YAML in.tekton/:
- Comment on PR: Details the error
- Namespace Events: Error logged in namespace event stream
- Controller Logs: Error appears in PAC controller logs
Check namespace events:
Subsequent PR Updates
Error comments are updated on new commits:- New errors replace the comment
- Fixed errors leave the comment (not deleted)
Cancelling PipelineRuns
Cancel In-Progress (Automatic)
Automatically cancel older runs when new commits are pushed:- Only cancels runs for the same PR or same branch (push events)
- Different PRs are isolated from each other
- Cancellation happens after the new PipelineRun starts
- Not compatible with
concurrency_limit
Cancel via GitOps Command
Cancel all PipelineRuns on a PR:Restarting PipelineRuns
GitHub Apps: Re-Run Button
Click Re-Run in the Checks tab:
You can:
- Re-run a single pipeline
- Re-run all checks
GitOps Commands
Restart failed PipelineRuns:Skip CI
Skip automatic pipeline execution by including skip commands in commit messages:[skip ci][ci skip][skip tkn][tkn skip]
How It Works
- Pull Requests
- Push Events
- No PipelineRuns created when PR opened/updated
- Neutral status check posted (“CI skipped”)
- Can still trigger manually with GitOps commands
GitOps Override
Skip commands can be overridden:When to Use Skip Commands
- Good Use Cases
- Avoid For
- Documentation-only changes
- README updates
- Comment/formatting changes
- WIP commits
- Minor typo fixes
Execution Namespace
PipelineRuns always execute in the namespace of the Repository CR.Status Updates
GitHub
GitHub Apps:- Detailed Checks with task-by-task status
- Log snippets on failures
- Task execution time
- Secrets automatically redacted
- Commit status (pending, success, failure)
- Link to logs
GitLab
Commit status updates:- Try source project (fork)
- Fallback to target project
- Comment if both fail
Forgejo/Gitea
Commit status on pull requests with overall pass/fail.Best Practices
Troubleshooting
PipelineRuns not triggering
annotations:
pipelinesascode.tekton.dev/on-event: "[pull_request]" # Must match event type
pipelinesascode.tekton.dev/on-target-branch: "[main]" # Must match target branch
GitHub bot issues
If GitHub bots aren’t triggering:- Bots are silently ignored unless authorized
- Add bots to OWNERS or Repository CR policy:
Draft PR not skipping
Add CEL expression:Next Steps
GitOps Commands
Control pipelines with /test, /retest, and /cancel commands
Event Matching
Advanced event matching with CEL expressions
Pipeline Resolution
Remote task and pipeline resolution
Repository CRD
Configure authorization policies
