Continuous integration 特定分支名称中的GITLAB-CI

Continuous integration 特定分支名称中的GITLAB-CI,continuous-integration,gitlab,branch,gitlab-ci,Continuous Integration,Gitlab,Branch,Gitlab Ci,当我在一个名为RCT_release/XX.XX.XX的分支上时,我想触发该作业 但我不能 我试过这个: send: stage: Copy_RCT environment: name: RCT script: - branch_name="$(echo $CI_COMMIT_REF_NAME|cut -d "_" -f1)" - echo $branch_name only: - pushes

当我在一个名为RCT_release/XX.XX.XX的分支上时,我想触发该作业 但我不能 我试过这个:

send:
    stage: Copy_RCT
    environment:
        name: RCT
    script:
        - branch_name="$(echo $CI_COMMIT_REF_NAME|cut -d "_" -f1)"
        - echo $branch_name
    only:
        - pushes
    only:
        - /^RCT_release.*$/

您应该尝试只允许分支,除了与regexp不同的一切:

only: 
  - branches 
except:
  - ^(?!(RCT_release.*$)$).*$
这将只允许分支,除了您的
RCT\u版本
分支之外的所有分支都例外


让我知道这是否有效。

您是否尝试仅使用推送删除第一个
?是的,但不起作用请使用我的更新答案,使用以下正则表达式尝试:
(!(RCT\u release.*$).*$).$
我认为问题来自“/:RCT\u release”/“00.00.00I再次更新,抱歉。您是否尝试使用另一个具有相同模式但不带“/”的分支?我尝试使用RCT_release01.01.01,因此问题来自诸如“.”和“/”之类的特殊字符。这很奇怪,它应该匹配。