Trigger PAC Pipelines
This page explains how PAC starts PipelineRuns after a repository is connected. To define the .tekton/ files that PAC selects, see Define PipelineRuns in Git.
PAC triggers pipelines in two ways:
- Automatic event triggers: a Git provider sends webhook events, and PAC matches those events against annotations on
PipelineRunfiles. - Comment command triggers: an authorized user comments with a PAC command such as
/test,/retest, or/cancel.
TOC
Automatic Event TriggersComment Command TriggersCommands on Pull Requests and Merge RequestsCommands on Commit CommentsPassing Parameters in CommandsProvider NotesVerify a TriggerNext StepsAutomatic Event Triggers
Automatic triggers are controlled by annotations in each PipelineRun under .tekton/. PAC reads the PipelineRun definitions from the Git ref that raised the event, matches the annotations, replaces PAC variables, and creates the matching PipelineRuns in the Repository namespace.
The table below explains which event source to use. For exact annotation syntax and examples, see Trigger Events.
Use custom comment triggers for repository-specific commands such as /deploy-preview. Use the built-in PAC commands below when you want PAC's native rerun, test, cancel, or approval behavior.
For more matching options, see the Pipelines as Code event matching documentation.
Comment Command Triggers
PAC also recognizes built-in GitOps commands in comments. These commands are useful when you want to run, rerun, approve, or cancel pipelines without pushing another commit.
Commands on Pull Requests and Merge Requests
Use these commands on an open PR or MR:
<pipelinerun> is the metadata.name or metadata.generateName value in the .tekton/ file, not the generated runtime name. For example, if the file has generateName: sv-event-pr-, use:
Commands on Commit Comments
GitHub and GitLab support /test, /retest, and /cancel on comments added to a pushed branch commit. /ok-to-test is for PR/MR authorization and does not apply to pushed commits.
When you comment on a commit, PAC must know which branch or tag context to use. If you do not specify one, PAC uses the repository default branch. The commented commit must be the HEAD commit of that branch, or the commit pointed to by the tag.
Use branch:<branch> when the commit belongs to a non-default branch:
Use tag:<tag> when the command should run in a tag context. Tag comment commands are currently supported on GitHub App and GitHub webhook integrations only:
The same branch argument is accepted by /retest and /cancel. On supported GitHub tag comments, the tag argument is also accepted:
Passing Parameters in Commands
Built-in commands can include key=value arguments. PAC parses them from the comment and can use them to override custom parameters defined in Repository.spec.params or supported standard variables:
Only parameters already defined for the Repository or recognized by PAC are applied. Arbitrary keys are ignored.
Provider Notes
For more command details, see the Pipelines as Code GitOps commands documentation.
Verify a Trigger
After an event or comment is sent, check the PipelineRuns in the namespace where the Repository CR is defined:
If no PipelineRun is created, check the event annotations and PAC controller logs:
Common checks:
Next Steps
- Define PipelineRuns in Git - PipelineRun files and trigger annotations
- Incoming Webhooks - Direct HTTP triggers for external systems
- Common Issues - Troubleshooting guide