trigger_pipeline
Triggers a Bitbucket pipeline run on a repository branch or commit, including custom pipelines and pipeline variables.
Instructions
Trigger a pipeline run on a repository.
Supports custom pipelines (from 'custom:' section in bitbucket-pipelines.yml)
and commit-based triggers.
Args:
repo_slug: Repository slug
branch: Branch to run pipeline on (default: main). Mutually exclusive with commit.
commit: Commit hash to run pipeline on. Mutually exclusive with branch.
custom_pipeline: Name of custom pipeline from 'custom:' section
(e.g., "deploy-staging", "dry-run")
variables: Pipeline variables as list of {key, value, secured?} objects.
Example: [{"key": "ENV", "value": "prod", "secured": false}]
Returns:
Pipeline run info with uuid and state
Examples:
# Default branch pipeline
trigger_pipeline(repo_slug="my-repo")
# Custom pipeline
trigger_pipeline(repo_slug="my-repo", custom_pipeline="deploy-staging")
# Custom pipeline on specific commit
trigger_pipeline(repo_slug="my-repo", commit="abc123", custom_pipeline="dry-run")
# With secured variables
trigger_pipeline(repo_slug="my-repo", variables=[
{"key": "ENV", "value": "prod"},
{"key": "SECRET", "value": "xxx", "secured": true}
])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| branch | No | ||
| commit | No | ||
| repo_slug | Yes | ||
| variables | No | ||
| custom_pipeline | No |