首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >具有特定glob模式的Bitbucket请求管道

具有特定glob模式的Bitbucket请求管道
EN

Stack Overflow用户
提问于 2022-10-31 10:54:34
回答 1查看 33关注 0票数 0

我在这里有点困惑,关于公关被触发的主要分支?

所有分支机构:(I know this will trigger pull request from any branch to any branch)

代码语言:javascript
复制
pipelines:
  pull-requests:
    '**':

主要分支:(Does this trigger pull request if created from feature/pe-1234 to main?)

代码语言:javascript
复制
pipelines:
  pull-requests:
    'main':

如果我只提到main,我想知道会发生什么。文档中不清楚,也可能是我搞错了

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-10-31 11:51:28

拉请求管道定义中的分支名称/ glob模式是应该触发该管道的分支,而不是目标分支。

例如,如果您跟踪的是git流而不是github流,那么覆盖PR从mainrelease/whatever分支运行的管道是有意义的,这样它就可以简单地通过,或者进行集成测试,但是不执行通常的测试、链接、覆盖等等。

代码语言:javascript
复制
pipelines:
  pull-requests:
    '**':  # triggers if no other specific pipeline was triggered
      - parallel:
          - step: *linting-step
          - step: *testing-step
    main:  # triggers from main to anywhere else
      - step:
          name: Pass
          script:
            - exit 0

如果遵循github流,您可能永远不会从main到其他任何地方进行公关,因此您可以安全地跳过这个定义。只有当您希望feature/AAA-NNNN分支的PRs触发测试工作流之外的特殊管道时,您才可以编写类似于

代码语言:javascript
复制
pipelines:
  pull-requests:
    '**':  # triggers if no other specific pipeline was triggered
      - parallel:
          - step: *linting-step
          - step: *testing-step
    feature/*:  # triggers from feature/* to anywhere else (including to main)
      - parallel:
          - step: *linting-step
          - step: *testing-step
          - step: *maybe-hook-issue-tracker-step # ?

这样,更简单的默认'**'管道就不会运行。但是不管目标分支如何,它都会运行,通常是main,但不一定。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74262193

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档