Quick Start
This guide is for users who want to connect a Git repository to an existing PAC installation and trigger the first PipelineRun.
TOC
IntroductionEstimated Reading TimePrerequisitesStep 1: Configure RepositoryConfirm tkn pac PluginCreate GitLab Personal Access TokenConfigure Repository with tkn pacStep 2: Create Your First PipelineStep 3: Test the PipelineTrigger via PushTrigger via Merge RequestCheck Pipeline StatusNext StepsIntroduction
You will:
- Create a PAC
Repositoryconnection withtkn pac - Add a simple
PipelineRundefinition to the repository - Trigger and check the first run
Estimated Reading Time
10-15 minutes
Prerequisites
- PAC is deployed and exposed to the Git provider network. See Manage PAC Component.
- If you use the UI to create or manage PAC
Repositoryresources, the administrator has enabled the Repository UI feature flag. See Enable Repository UI Feature. - The
pipelines-as-code-infoConfigMap has the public PACcontroller-url. - You know the PAC namespace if you use
tkn pac. The default istekton-pipelines. - You have the PAC webhook URL when automatic registration is disabled or fails. See Get the PAC Webhook URL.
kubectlis configured for the target cluster.tknCLI is installed with thepacplugin. See tkn pac Command Reference.- You have administrator or maintainer access to the Git repository.
Step 1: Configure Repository
The steps below use the tkn pac CLI and GitLab as an example. For GitHub or manifest-based setup, see Configure GitHub Repository or Configure GitLab Repository.
When a Repository has spec.git_provider.type set to github or gitlab, spec.git_provider.webhook_secret, and either a usable Repository-local provider token or a matching centralized webhook registration credential, the webhook registration controller automatically registers or updates the Git provider webhook. Repositories without a supported spec.git_provider.type are skipped, with the reason recorded as a Repository Event and status annotations.
--pac-namespaceis the namespace where PAC is deployed. The default istekton-pipelines.- The interactive prompt for pipeline namespace is where the
RepositoryandPipelineRunresources are created. Create that namespace before running the command.
Confirm tkn pac Plugin
Confirm the plugin is available:
Example output:
Create GitLab Personal Access Token
- Go to GitLab → Settings → Access Tokens
- Create a token with
apiscope - Save the token securely
Configure Repository with tkn pac
Run the command from the Git repository directory. The .tekton directory will be created in the current working directory.
Replace tekton-pipelines if PAC was deployed in a different namespace.
Follow the interactive prompts:
- Enter Git repository URL (auto-detected from current directory, or enter manually)
- Enter namespace for pipelines, for example
project-pipelines. The namespace must already exist. - Repository CR will be created at this point
- Enter GitLab project ID (found in project settings → General)
- Enter the PAC webhook URL if prompted. In clusters with automatic registration enabled, this URL is read from
pipelines-as-code-info. - Enter webhook secret (or press Enter to use auto-generated default)
- Enter GitLab access token (the Personal Access Token you created)
- Enter GitLab API URL (default:
https://gitlab.com, or enter your self-hosted GitLab URL)
The command will:
- Create the
Repositoryresource in the selected namespace - Configure GitLab webhook automatically
- Create Kubernetes Secret with credentials
- Generate
.tekton/pipelinerun.yamltemplate in your repository
Step 2: Create Your First Pipeline
The tkn pac create repo command creates a basic template at .tekton/pipelinerun.yaml. Edit it to define your pipeline:
Commit and push to your repository:
Note:
- Replace
<your-branch-name>with your branch name (e.g.,main,master, ordevelop) - Make sure the annotation
pipelinesascode.tekton.dev/on-target-branchmatches your branch name. For example, if your branch ismain, use"[refs/heads/main]"; if it'stest, use"[refs/heads/test]" - To match multiple branches, use comma-separated values:
"[main, develop]"or"[refs/heads/main,refs/heads/develop]" - To match all branches, use:
"[refs/heads/*]"
Step 3: Test the Pipeline
Trigger via Push
Push a commit to the branch specified in your pipeline annotation to trigger the pipeline:
Trigger via Merge Request
Create a Merge Request to trigger the pipeline:
Then create a Merge Request in GitLab.
Check Pipeline Status
View PipelineRuns in the namespace:
Example output:
View pipeline logs:
Example output:
Example output:
Next Steps
- Manage PAC Component - Deploy, update, and uninstall guide
- Guides - End-to-end repository configuration walkthroughs
- Define PipelineRuns in Git - PipelineRun files and trigger annotations
- Trigger PAC Pipelines - Automatic events and comment commands