限制Bitbucket Pipelines触发器仅在指定分支上工作的代码示例:
pipelines:
branches:
master:
- step:
script:
- echo "This pipeline will only run on the master branch"
feature/*:
- step:
script:
- echo "This pipeline will run on feature branches starting with 'feature/'"
上述示例可以限制Bitbucket Pipelines仅在“master”分支和以“feature/”开头的分支上触发。这样可以避免不必要的触发,保持管道的清洁和可靠性。