如何避免在 codemagic 中从 git 触发构建

How to avoid triggering builds from git in codemagic

有没有办法跳过 github 构建?问题是我的构建在推送到分支时自动触发,但是合并到主分支并触发构建后 automatically.I 想升级应用程序的 flutter 版本,进行提交和标记,将更改推送到同一个分支。问题是,在将构建的新版本从 codemagic 本身推送到当前分支后,codemagic 再次触发构建,我得到了一个递归。有谁知道工作方式? this, also tried to disable trigger builds on tags and push changes from script with tag at the same time Codemagic build settings Codemagic scriptBranch example.

我都试过了

Codemagic 构建脚本:

 #!/usr/bin/env bash

    set -e # exit on first failed command
    set -x # print all executed commands to the log
    
    #if [ "$FCI_BUILD_STEP_STATUS" = "success" ]
    #then
      
      #bump code version
      perl -i -pe 's/^(version:\s+\d+\.\d+\.\d+\+)(\d+)$/.(+1)/e' pubspec.yaml
    
      #create a tag and publish
      v=`grep 'version: ' pubspec.yaml | sed 's/version: //'`
      version="dev-$v"
    
      git commit -m "Bump version to $version" pubspec.yaml 
    
      git tag -a -m "Bump app version" $version 
    
      git push "https://user:$GITHUB_SSH@github.com/repo/mobile" --follow-tags
      #fi

您可以在提交消息中添加“skip ci”或“ci skip”。

它是 Codemagic 和其他持续集成服务的标准。