This is an automated email from the ASF dual-hosted git repository.

englefly pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 34f500ac2a6 [github](action) optimize trigger teamcity pipeline 
(#27257)
34f500ac2a6 is described below

commit 34f500ac2a6cadedd84ecbb3667a1929e370d683
Author: Dongyang Li <[email protected]>
AuthorDate: Wed Nov 22 09:34:47 2023 +0800

    [github](action) optimize trigger teamcity pipeline (#27257)
    
    optimize triiger teamcity pipeline
---
 .github/workflows/auto_trigger_teamcity.yml       | 143 -----------
 .github/workflows/comment-to-trigger-teamcity.yml | 253 ++++++++++++++++++++
 regression-test/pipeline/common/github-utils.sh   | 193 +++++++++++++++
 regression-test/pipeline/common/teamcity-utils.sh | 274 ++++++++++++++++++++++
 4 files changed, 720 insertions(+), 143 deletions(-)

diff --git a/.github/workflows/auto_trigger_teamcity.yml 
b/.github/workflows/auto_trigger_teamcity.yml
deleted file mode 100644
index ab3e85fa6b5..00000000000
--- a/.github/workflows/auto_trigger_teamcity.yml
+++ /dev/null
@@ -1,143 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-name: Auto trigger teamcity
-
-on:
-  issue_comment:
-    types: [created, edited]
-  pull_request_review_comment:
-    types: [created, edited]
-
-env:
-  PULL_REQUEST_NUM: $(echo "${{ github.event.issue.pull_request.url }}" | awk 
-F/ '{print $NF}')
-  LATEST_COMMIT: $(curl -s -H "Authorization:Bearer ${{ secrets.GITHUB_TOKEN 
}}" "https://api.github.com/repos/${{ github.repository }}/pulls/$(echo '${{ 
github.event.issue.pull_request.url }}' | awk -F/ '{print $NF}')" > 
pr_details.json && jq -r '.head.sha' pr_details.json)
-  TEAMCITY_URL: '-H \"Content-Type:text/plain\" -H \"Accept: 
application/json\" -u OneMoreChance:OneMoreChance http://43.132.222.7:8111'
-
-jobs:
-  run_teamcity_pipeline:
-    if: (contains(github.event.comment.body, 'buildall') || 
contains(github.event.comment.body, 'p0') || 
contains(github.event.comment.body, 'pipelinex_p0') || 
contains(github.event.comment.body, 'p1') || 
contains(github.event.comment.body, 'feut') || 
contains(github.event.comment.body, 'beut') || 
contains(github.event.comment.body, 'compile') || 
contains(github.event.comment.body, 'clickbench') || 
contains(github.event.comment.body, 'arm') || 
contains(github.event.comment.body, 'externa [...]
-
-    runs-on: ubuntu-latest
-
-    env:
-      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-      ISSUE_COMMENT: ${{ github.event.comment.body }}
-    steps:
-      - name: Run pipeline by teamcity restful
-        run: |
-          if [ "_xx""${{ github.event.issue.pull_request.url }}" != "_xx" ]; 
then
-            echo "Comment was made on pull request: $(echo ${{ 
github.event.issue.pull_request.url }} | awk -F/ '{print $NF}')"
-          else
-            echo "Comment was made on an issue, not a pull request."
-          fi
-          pull_request_num=${{ env.PULL_REQUEST_NUM }}
-          encoded_string=$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' 
"$ISSUE_COMMENT")
-          comment_message="$ISSUE_COMMENT"
-          latest_commit_id="${{ env.LATEST_COMMIT }}"
-          teamcity_url="${{ env.TEAMCITY_URL }}"
-          trigger_pipelines=""
-          same_build_sign="false"
-          echo "pull_request_num : ${pull_request_num}"
-          echo "encoded_string : ${encoded_string}"
-          echo "latest_commit_id : ${{ env.LATEST_COMMIT }}"
-          
-          set -x
-          reg="run 
(buildall|compile|p0|p1|feut|beut|external|clickbench|pipelinex_p0|arm|tpch)( 
[1-9]*[0-9]+)*"
-          comment_trigger_type="$(echo "${comment_message}" | grep -E "${reg}" 
| awk -F' ' '{print $2}' | sed -n 1p)"
-          comment_repeat_times="$(echo "${comment_message}" | grep -E "${reg}" 
| awk -F' ' '{print $3}' | sed -n 1p)"
-          if [[ "${comment_trigger_type}" == "buildall" ]]; then 
-            trigger_pipelines="Doris_Doris_FeUt Doris_DorisBeUt_BeUt 
Doris_DorisCompile_Compile Doris_Performance_Clickbench_ClickbenchNew 
Doris_ArmPipeline_P0Regression"
-          elif [[ "${comment_trigger_type}" == "compile" ]]; then 
-            trigger_pipelines="Doris_DorisCompile_Compile"
-          elif [[ "${comment_trigger_type}" == "p0" ]]; then 
-            trigger_pipelines="Doris_DorisRegression_P0Regression"
-          elif [[ "${comment_trigger_type}" == "p1" ]]; then 
-            trigger_pipelines="Doris_DorisRegression_P1Regression"
-          elif [[ "${comment_trigger_type}" == "feut" ]]; then 
-            trigger_pipelines="Doris_Doris_FeUt"
-          elif [[ "${comment_trigger_type}" == "beut" ]]; then 
-            trigger_pipelines="Doris_DorisBeUt_BeUt"
-          elif [[ "${comment_trigger_type}" == "external" ]]; then 
-            trigger_pipelines="Doris_External_Regression"
-          elif [[ "${comment_trigger_type}" == "clickbench" ]]; then 
-            trigger_pipelines="Doris_Performance_Clickbench_ClickbenchNew"
-          elif [[ "${comment_trigger_type}" == "pipelinex_p0" ]]; then 
-            trigger_pipelines="Doris_DorisRegression_P0RegressionPipelineX"
-          elif [[ "${comment_trigger_type}" == "arm" ]]; then 
-            trigger_pipelines="Doris_ArmPipeline_P0Regression"
-          elif [[ "${comment_trigger_type}" == "tpch" ]]; then
-            trigger_pipelines="Tpch_TpchSf100"
-          fi
-          if [ -z "${trigger_pipelines}" ];then
-            echo "Just a general comment that doesn't match any pipeline rules"
-          fi
-          set +x
-          
-          echo "need run pipelines: ${trigger_pipelines}"
-          
-          for pipeline in ${trigger_pipelines}
-          do
-            same_build_sign="false"
-            echo 
"-----------------------------------------------------------------"
-            running_builds_command="curl -s -X GET 
${teamcity_url}/app/rest/builds\?locator\=buildType\:${pipeline}\,branch:pull/${pull_request_num}\,running:true"
-            echo "${running_builds_command}" 
-            running_builds_list=$(eval "${running_builds_command}" > 
running_builds.json && jq -r '.build[].id' running_builds.json)
-            echo "running_builds_list : ${running_builds_list}"
-          
-            queue_builds_command="curl -s -X GET 
${teamcity_url}/app/rest/buildQueue\?locator\=buildType\:${pipeline}"
-            echo "${queue_builds_command}"
-            eval "${queue_builds_command}" > queue_builds.json
-            queue_builds_list=$(cat queue_builds.json | jq ".build[] | 
select(.branchName == \"pull/${pull_request_num}\") | .id" )
-            echo "queue builds list: ${queue_builds_list}"
-          
-            merged_list=("${running_builds_list[@]} ${queue_builds_list[@]}")
-            echo "merged_list :  ${merged_list}"
-          
-            for build in ${merged_list}; do
-              running_commit_command="curl -s -X GET 
${teamcity_url}/app/rest/builds/${build}"
-              echo "${running_commit_command}"
-              eval "${running_commit_command}" > build_commit_info.json
-              running_commit_id=$(jq -r '.revisions.revision[0].version' 
build_commit_info.json)
-              running_env_commit_id=$(cat build_commit_info.json | jq 
".properties.property[] | select(.name == \"env.latest_commit_id\") | .value")
-
-              if [[ "_"${latest_commit_id} == "_"${running_commit_id} || 
_"\"${latest_commit_id}\"" == "_"${running_env_commit_id} ]];then
-                echo "the same pr_commit build already exist, this build 
${build} is running or in queue!"
-                same_build_sign="true" 
-                break
-              fi
-            done
-          
-            if [ "_""${same_build_sign}" == "_false" ];then
-              sleep 10s
-              echo "there is no running build or queue build, so trigger a new 
!"
-              echo "comment_repeat_times: ${comment_repeat_times}"
-              if [[ -n "${comment_repeat_times}" ]]; then
-                execute_command="curl -s -X POST 
${teamcity_url}/httpAuth/action.html\?add2Queue\=${pipeline}\&branchName\=pull/${pull_request_num}\&name=env.latest_pr_comment\&value=${encoded_string}\&name=env.latest_commit_id\&value=${latest_commit_id}\&name=env.repeat_times\&value=${comment_repeat_times}"
-              else
-                execute_command="curl -s -X POST 
${teamcity_url}/httpAuth/action.html\?add2Queue\=${pipeline}\&branchName\=pull/${pull_request_num}\&name=env.latest_pr_comment\&value=${encoded_string}\&name=env.latest_commit_id\&value=${latest_commit_id}"
-              fi
-              echo "${execute_command}"
-              eval "${execute_command}"
-              echo 
"-----------------------------------------------------------------"
-            else 
-              echo "there is same pr commit task in queue,so skip trigger !"
-              echo 
"-----------------------------------------------------------------"
-            fi
-          done
-          
-          
diff --git a/.github/workflows/comment-to-trigger-teamcity.yml 
b/.github/workflows/comment-to-trigger-teamcity.yml
new file mode 100644
index 00000000000..0057dc7f4d6
--- /dev/null
+++ b/.github/workflows/comment-to-trigger-teamcity.yml
@@ -0,0 +1,253 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+name: Comment to trigger teamcity
+
+on:
+  issue_comment:
+    types: [created, edited]
+
+jobs:
+  check-comment-if-need-to-trigger-teamcity:
+
+    # This job only runs for pull request comments, and comment body contains 
'run'
+    if: ${{ github.event.issue.pull_request && 
contains(github.event.comment.body, 'run') }}
+
+    runs-on: ubuntu-latest
+    env:
+      COMMENT_BODY: ${{ github.event.comment.body }}
+      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+    steps:
+    - name: "Parse PR comment"
+      id: parse
+      run: |
+        COMMENT_BODY=$(echo "${COMMENT_BODY}" | xargs)
+        if [[ "${COMMENT_BODY}" == *'run buildall'* ||
+            "${COMMENT_BODY}" == *'run compile'* ||
+            "${COMMENT_BODY}" == *'run beut'* ||
+            "${COMMENT_BODY}" == *'run feut'* ||
+            "${COMMENT_BODY}" == *'run p0'* ||
+            "${COMMENT_BODY}" == *'run p1'* ||
+            "${COMMENT_BODY}" == *'run external'* ||
+            "${COMMENT_BODY}" == *'run pipelinex_p0'* ||
+            "${COMMENT_BODY}" == *'run clickbench'* ||
+            "${COMMENT_BODY}" == *'run arm'* ||
+            "${COMMENT_BODY}" == *'run tpch'* ]]; then
+            echo "comment_trigger=true" | tee -a "$GITHUB_OUTPUT"
+        else
+            echo "find no keyword in comment body, skip this action."
+            exit
+        fi
+
+        PULL_REQUEST_NUM="$(echo "${{ github.event.issue.pull_request.url }}" 
| awk -F/ '{print $NF}')"
+        COMMIT_ID_FROM_TRIGGER="$(curl -s -H "Authorization:Bearer ${{ 
secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository 
}}/pulls/${PULL_REQUEST_NUM}" | jq -r '.head.sha')"
+        TARGET_BRANCH="$(curl -s -H "Authorization:Bearer ${{ 
secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository 
}}/pulls/${PULL_REQUEST_NUM}" | jq -r '.base.ref')"
+        echo "PULL_REQUEST_NUM=${PULL_REQUEST_NUM}" | tee -a "$GITHUB_OUTPUT"
+        echo "COMMIT_ID_FROM_TRIGGER=${COMMIT_ID_FROM_TRIGGER}" | tee -a 
"$GITHUB_OUTPUT"
+        echo "TARGET_BRANCH='${TARGET_BRANCH}'" | tee -a "$GITHUB_OUTPUT"
+        echo "COMMENT_BODY='${COMMENT_BODY}'" | tee -a "$GITHUB_OUTPUT"
+
+        reg="run 
(buildall|compile|p0|p1|feut|beut|external|clickbench|pipelinex_p0|arm|tpch)( 
[1-9]*[0-9]+)*"
+        COMMENT_TRIGGER_TYPE="$(echo "${COMMENT_BODY}" | xargs | grep -E 
"${reg}" | awk -F' ' '{print $2}' | sed -n 1p)"
+        COMMENT_REPEAT_TIMES="$(echo "${COMMENT_BODY}" | xargs | grep -E 
"${reg}" | awk -F' ' '{print $3}' | sed -n 1p)"
+        echo "COMMENT_TRIGGER_TYPE=${COMMENT_TRIGGER_TYPE}" | tee -a 
"$GITHUB_OUTPUT"
+        echo "COMMENT_REPEAT_TIMES=${COMMENT_REPEAT_TIMES}" | tee -a 
"$GITHUB_OUTPUT"
+
+    - name: "Checkout master"
+      if: ${{ steps.parse.outputs.comment_trigger }}
+      uses: actions/checkout@v4
+
+    - name: "Check if pr need run build"
+      if: ${{ steps.parse.outputs.comment_trigger }}
+      id: changes
+      run: |
+        source regression-test/pipeline/common/github-utils.sh
+        set -x
+        if _get_pr_changed_files "${{ steps.parse.outputs.PULL_REQUEST_NUM 
}}"; then
+          if file_changed_fe_ut; then
+            echo "changed_fe_ut=true" | tee -a "$GITHUB_OUTPUT"
+          fi
+          if file_changed_be_ut; then
+            echo "changed_be_ut=true" | tee -a "$GITHUB_OUTPUT"
+          fi
+          if file_changed_ckb; then
+            echo "changed_ckb=true" | tee -a "$GITHUB_OUTPUT"
+            echo "changed_tpch=true" | tee -a "$GITHUB_OUTPUT"
+          fi
+          if file_changed_regression_p0; then
+            echo "changed_p0=true" | tee -a "$GITHUB_OUTPUT"
+            echo "changed_external=true" | tee -a "$GITHUB_OUTPUT"
+            echo "changed_pipelinex_p0=true" | tee -a "$GITHUB_OUTPUT"
+            echo "changed_arm=true" | tee -a "$GITHUB_OUTPUT"
+          fi
+          if file_changed_regression_p1; then
+            echo "changed_p1=true" | tee -a "$GITHUB_OUTPUT"
+          fi
+        else
+          echo "INFO: failed to _get_pr_changed_files, default trigger all"
+          echo "changed_fe_ut=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_be_ut=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_ckb=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_tpch=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_p0=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_external=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_pipelinex_p0=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_arm=true" | tee -a "$GITHUB_OUTPUT"
+          echo "changed_p1=true" | tee -a "$GITHUB_OUTPUT"
+        fi
+
+    # - name: "Setup tmate session"
+    #   if: ${{ failure() }}
+    #   uses: mxschmitt/action-tmate@v3
+
+    - name: "Trigger or Skip feut"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["feut", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_fe_ut }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "feut" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+
+    - name: "Trigger or Skip beut"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["beut", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_be_ut }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "beut" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip compile"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["compile", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_p0 }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "compile" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip p0"
+      if: ${{ steps.parse.outputs.comment_trigger && contains(fromJSON('["p0", 
"buildall"]'), steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        if [[ ${{ steps.parse.outputs.COMMENT_TRIGGER_TYPE }} == "buildall" 
]]; then
+          echo "COMMENT_TRIGGER_TYPE is buildall, trigger compile is enough, 
compile will trigger p0" && exit
+        fi
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_p0 }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "p0" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip p1"
+      if: ${{ steps.parse.outputs.comment_trigger && contains(fromJSON('["p1", 
"buildall"]'), steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        COMMIT_ID_FROM_TRIGGER=${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER 
}}
+        if [[ ${{ steps.parse.outputs.COMMENT_TRIGGER_TYPE }} == "buildall" 
]]; then
+          echo "COMMENT_TRIGGER_TYPE is buildall, trigger compile is enough, 
compile will trigger p1" && exit
+        fi
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_p1 }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "p1" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip external"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["external", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        if [[ ${{ steps.parse.outputs.COMMENT_TRIGGER_TYPE }} == "buildall" 
]]; then
+          echo "COMMENT_TRIGGER_TYPE is buildall, trigger compile is enough, 
compile will trigger external" && exit
+        fi
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_external }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "external" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip pipelinex_p0"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["pipelinex_p0", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        if [[ ${{ steps.parse.outputs.COMMENT_TRIGGER_TYPE }} == "buildall" 
]]; then
+          echo "COMMENT_TRIGGER_TYPE is buildall, trigger compile is enough, 
compile will trigger pipelinex_p0" && exit
+        fi
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_pipelinex_p0 }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "pipelinex_p0" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip arm"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["arm", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_arm }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "arm" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip clickbench"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["clickbench", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_ckb }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "clickbench" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
+
+    - name: "Trigger or Skip tpch"
+      if: ${{ steps.parse.outputs.comment_trigger && 
contains(fromJSON('["tpch", "buildall"]'), 
steps.parse.outputs.COMMENT_TRIGGER_TYPE) }}
+      run: |
+        source ./regression-test/pipeline/common/teamcity-utils.sh
+        if [[ ${{ steps.parse.outputs.COMMENT_TRIGGER_TYPE }} == "buildall" 
]]; then
+          echo "COMMENT_TRIGGER_TYPE is buildall, trigger clickbench is 
enough, clickbench will trigger tpch" && exit
+        fi
+        set -x
+        trigger_or_skip_build \
+          "${{ steps.changes.outputs.changed_tpch }}" \
+          "${{ steps.parse.outputs.PULL_REQUEST_NUM }}" \
+          "${{ steps.parse.outputs.COMMIT_ID_FROM_TRIGGER }}" \
+          "tpch" \
+          "${{ steps.parse.outputs.COMMENT_REPEAT_TIMES }}"
diff --git a/regression-test/pipeline/common/github-utils.sh 
b/regression-test/pipeline/common/github-utils.sh
index c8c5ba213fb..4a7cfd4ed26 100644
--- a/regression-test/pipeline/common/github-utils.sh
+++ b/regression-test/pipeline/common/github-utils.sh
@@ -63,3 +63,196 @@ ${COMMENT_BODY}
 "
     create_an_issue_comment "${ISSUE_NUMBER}" "${COMMENT_BODY}"
 }
+
+_get_pr_changed_files_count() {
+    PULL_NUMBER="${PULL_NUMBER:-$1}"
+    if [[ -z "${PULL_NUMBER}" ]]; then
+        echo "Usage: _get_pr_changed_files_count PULL_NUMBER"
+        return 1
+    fi
+
+    OWNER="${OWNER:=apache}"
+    REPO="${REPO:=doris}"
+    try_times=10
+    while [[ ${try_times} -gt 0 ]]; do
+        set -x
+        if ret=$(
+            curl -s -H "Accept: application/vnd.github+json" \
+                
https://api.github.com/repos/"${OWNER}"/"${REPO}"/pulls/"${PULL_NUMBER}"; | jq 
-e '.changed_files'
+        ); then
+            set +x
+            echo "${ret}" && return
+        fi
+        sleep 1s
+        try_times=$((try_times - 1))
+    done
+    set +x
+    if [[ ${try_times} -eq 0 ]]; then echo "Failed to get pr(${PULL_NUMBER}) 
changed file count" && return 1; fi
+}
+
+_get_pr_changed_files() {
+    usage_str="Usage:
+    _get_pr_changed_files <PULL_NUMBER> [OPTIONS]
+    note: https://github.com/apache/doris/pull/13259, PULL_NUMBER is 13259
+    OPTIONS can be one of [all|added|modified|removed], default is all
+    "
+    if [[ -z "$1" ]]; then echo -e "${usage_str}" && return 1; fi
+    if ! curl --version >/dev/null; then echo 'error: curl required...' && 
return 1; fi
+    if ! command -v jq >/dev/null; then sudo yum install jq -y || sudo apt 
install -y jq; fi
+
+    PULL_NUMBER="$1"
+    which_file="$2"
+    
pr_url="https://github.com/${OWNER:=apache}/${REPO:=doris}/pull/${PULL_NUMBER}";
+    # The number of results per page (max 100), Default 30.
+    per_page=100
+    file_name='pr_changed_files'
+    rm -f "${file_name}"
+    page=1
+    if ! changed_files_count="$(_get_pr_changed_files_count 
"${PULL_NUMBER}")"; then return 1; fi
+    while [[ ${changed_files_count} -gt 0 ]]; do
+        try_times=10
+        while [[ ${try_times} -gt 0 ]]; do
+            set -x
+            if curl -s \
+                -H "Accept: application/vnd.github+json" \
+                
https://api.github.com/repos/"${OWNER}"/"${REPO}"/pulls/"${PULL_NUMBER}"/files?page="${page}"\&per_page="${per_page}";
 \
+                >>"${file_name}"; then
+                set +x
+                break
+            else
+                set +x
+                try_times=$((try_times - 1))
+            fi
+        done
+        page=$((page + 1))
+        changed_files_count=$((changed_files_count - per_page))
+    done
+    if [[ ${try_times} -eq 0 ]]; then echo -e "\033[31m List pull 
request(${pr_url}) files FAIL... \033[0m" && return 1; fi
+
+    all_files=$(jq -r '.[] | .filename' "${file_name}")
+    added_files=$(jq -r '.[] | select(.status == "added") | .filename' 
"${file_name}")
+    modified_files=$(jq -r '.[] | select(.status == "modified") | .filename' 
"${file_name}")
+    removed_files=$(jq -r '.[] | select(.status == "removed") | .filename' 
"${file_name}")
+    rm "${file_name}"
+    if [[ -z "${all_files}" ]]; then echo -e "\033[31m List pull 
request(${pr_url}) files FAIL... \033[0m" && return 1; fi
+
+    echo -e "
+https://github.com/apache/doris/pull/${PULL_NUMBER}/files all change files:
+---------------------------------------------------------------"
+    if [[ "${which_file:-all}" == "all" ]]; then
+        echo -e "${all_files}\n" && export all_files
+    elif [[ "${which_file}" == "added" ]]; then
+        echo -e "${added_files}\n" && export added_files
+    elif [[ "${which_file}" == "modified" ]]; then
+        echo -e "${modified_files}\n" && export modified_files
+    elif [[ "${which_file}" == "removed" ]]; then
+        echo -e "${removed_files}\n" && export removed_files
+    else
+        return 1
+    fi
+}
+
+_only_modified_regression_conf() {
+    if [[ -n ${added_files} || -n ${removed_files} ]]; then
+        # echo "Not only modified regression conf, find added/removed files"
+        return 1
+    fi
+    if [[ -z ${modified_files} ]]; then
+        # echo "modified_files is empty, return false"
+        return 1
+    fi
+    for f in ${modified_files}; do
+        if [[ "${f}" == 
"regression-test/pipeline/p0/conf/regression-conf.groovy" ]] ||
+            [[ "${f}" == 
"regression-test/pipeline/p1/conf/regression-conf.groovy" ]]; then
+            continue
+        else
+            # echo "Not only modified regression conf"
+            return 1
+        fi
+    done
+    # echo "only modified regression conf"
+    return 0
+}
+
+file_changed_fe_ut() {
+    if _only_modified_regression_conf; then echo "return no need" && return 1; 
fi
+    if [[ -z ${all_files} ]]; then echo "return need" && return 0; fi
+    for af in ${all_files}; do
+        if [[ "${af}" == 'fe'* ]] ||
+            [[ "${af}" == 'fe_plugins'* ]] ||
+            [[ "${af}" == 'bin/start_fe.sh' ]] ||
+            [[ "${af}" == 'docs/zh-CN/docs/sql-manual/'* ]] ||
+            [[ "${af}" == 'docs/en/docs/sql-manual/'* ]] ||
+            [[ "${af}" == 'bin/stop_fe.sh' ]] ||
+            [[ "${af}" == 'run-fe-ut.sh' ]]; then echo "fe-ut related file 
changed, return need" && return 0; fi
+    done
+    echo "return no need" && return 1
+}
+
+file_changed_be_ut() {
+    if _only_modified_regression_conf; then echo "return no need" && return 1; 
fi
+    if [[ -z ${all_files} ]]; then echo "return need" && return 0; fi
+    for af in ${all_files}; do
+        if [[ "${af}" == 'be'* ]] ||
+            [[ "${af}" == 'contrib'* ]] ||
+            [[ "${af}" == 'thirdparty'* ]] ||
+            [[ "${af}" == 'bin/start_be.sh' ]] ||
+            [[ "${af}" == 'bin/stop_be.sh' ]] ||
+            [[ "${af}" == 'run-be-ut.sh' ]]; then
+            echo "be-ut related file changed, return need" && return 0
+        fi
+    done
+    echo "return no need" && return 1
+}
+
+file_changed_regression_p0() {
+    if _only_modified_regression_conf; then echo "return no need" && return 1; 
fi
+    if [[ -z ${all_files} ]]; then echo "return need" && return 0; fi
+    for af in ${all_files}; do
+        if [[ "${af}" == 'be'* ]] ||
+            [[ "${af}" == 'bin'* ]] ||
+            [[ "${af}" == 'conf'* ]] ||
+            [[ "${af}" == 'contrib'* ]] ||
+            [[ "${af}" == 'fe'* ]] ||
+            [[ "${af}" == 'fe_plugins'* ]] ||
+            [[ "${af}" == 'gensrc'* ]] ||
+            [[ "${af}" == 'regression-test'* ]] ||
+            [[ "${af}" == 'thirdparty'* ]] ||
+            [[ "${af}" == 'docker'* ]] ||
+            [[ "${af}" == 'ui'* ]] ||
+            [[ "${af}" == 'webroot'* ]] ||
+            [[ "${af}" == 'build.sh' ]] ||
+            [[ "${af}" == 'env.sh' ]] ||
+            [[ "${af}" == 'run-regression-test.sh' ]]; then
+            echo "regression related file changed, return need" && return 0
+        fi
+    done
+    echo "return no need" && return 1
+}
+
+file_changed_regression_p1() {
+    file_changed_regression_p0
+}
+
+file_changed_arm_regression_p0() {
+    if [[ $(($1 % 2)) -eq 0 ]]; then echo "the pull request id is even, return 
no need" && return 1; fi
+    file_changed_regression_p0
+}
+
+file_changed_ckb() {
+    if _only_modified_regression_conf; then echo "return no need" && return 1; 
fi
+    if [[ -z ${all_files} ]]; then echo "return need" && return 0; fi
+    for af in ${all_files}; do
+        if [[ "${af}" == 'be'* ]] ||
+            [[ "${af}" == 'bin'* ]] ||
+            [[ "${af}" == 'conf'* ]] ||
+            [[ "${af}" == 'fe'* ]] ||
+            [[ "${af}" == 'gensrc'* ]] ||
+            [[ "${af}" == 'thirdparty'* ]] ||
+            [[ "${af}" == 'build.sh' ]] ||
+            [[ "${af}" == 'env.sh' ]]; then
+            echo "clickbench performance related file changed, return need" && 
return 0
+        fi
+    done
+    echo "return no need" && return 1
+}
diff --git a/regression-test/pipeline/common/teamcity-utils.sh 
b/regression-test/pipeline/common/teamcity-utils.sh
new file mode 100644
index 00000000000..3aa1e3d0def
--- /dev/null
+++ b/regression-test/pipeline/common/teamcity-utils.sh
@@ -0,0 +1,274 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+#!/bin/bash
+
+# github中评论的要触发的流水线名字
+# 到
+# teamcity流水线实际的名称
+# 的映射
+# 新加流水线需要修改这里
+declare -A comment_to_pipeline
+comment_to_pipeline=(
+    ['feut']='Doris_Doris_FeUt'
+    ['beut']='Doris_DorisBeUt_BeUt'
+    ['compile']='Doris_DorisCompile_Compile'
+    ['p0']='Doris_DorisRegression_P0Regression'
+    ['p1']='Doris_DorisRegression_P1Regression'
+    ['external']='Doris_External_Regression'
+    ['clickbench']='Doris_Performance_Clickbench_ClickbenchNew'
+    ['pipelinex_p0']='Doris_DorisRegression_P0RegressionPipelineX'
+    ['arm']='Doris_ArmPipeline_P0Regression'
+    ['tpch']='Tpch_TpchSf100'
+)
+
+# github中评论的要触发的流水线名字
+# 到
+# teamcity流水线返回结果给github的名称
+# 的映射
+# 新加流水线需要修改这里
+declare -A conment_to_context
+conment_to_context=(
+    ['compile']='COMPILE (DORIS_COMPILE)'
+    ['feut']='FE UT (Doris FE UT)'
+    ['beut']='BE UT (Doris BE UT)'
+    ['p0']='P0 Regression (Doris Regression)'
+    ['p1']='P1 Regression (Doris Regression)'
+    ['external']='External Regression (Doris External Regression)'
+    ['pipelinex_p0']='P0 Regression PipelineX (Doris Regression)'
+    ['clickbench']='clickbench-new (clickbench)'
+    ['arm']='P0 Regression (ARM pipeline)'
+    ['tpch']='tpch-sf100 (tpch)'
+)
+
+get_commit_id_of_build() {
+    # 获取某个build的commit id
+    if [[ -z "$1" ]]; then return 1; fi
+    build_id="$1"
+    set -x
+    if ret=$(
+        curl -s -X GET \
+            -u OneMoreChance:OneMoreChance \
+            -H "Content-Type:text/plain" \
+            -H "Accept: application/json" \
+            "http://43.132.222.7:8111/app/rest/builds/${build_id}";
+    ); then
+        set +x
+        commit_id=$(echo "${ret}" | jq -r '.revisions.revision[0].version')
+        echo "${commit_id}"
+    else
+        set +x
+        return 1
+    fi
+}
+
+get_running_build_of_pr() {
+    # "获取pr在某条流水线上正在跑的build"
+    PULL_REQUEST_NUM="${PULL_REQUEST_NUM:-$1}"
+    COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$2}"
+    if [[ -z "${PULL_REQUEST_NUM}" || -z "${COMMENT_TRIGGER_TYPE}" ]]; then
+        echo "Usage: get_queue_build_of_pr PULL_REQUEST_NUM 
COMMENT_TRIGGER_TYPE" && return 1
+    fi
+
+    PIPELINE="${comment_to_pipeline[${COMMENT_TRIGGER_TYPE}]}"
+    local running_builds_list
+    set -x
+    if ret=$(
+        curl -s -X GET \
+            -u OneMoreChance:OneMoreChance \
+            -H "Content-Type:text/plain" \
+            -H "Accept: application/json" \
+            
"http://43.132.222.7:8111/app/rest/builds?locator=buildType:${PIPELINE},branch:pull/${PULL_REQUEST_NUM},running:true";
+    ); then
+        set +x
+        running_builds_list=$(echo "${ret}" | jq -r '.build[].id')
+        echo "${running_builds_list}"
+    else
+        set +x
+        return 1
+    fi
+}
+# get_running_build_of_pr "$1" "$2"
+
+get_queue_build_of_pr() {
+    # "获取pr在某条流水线上排队的build"
+    PULL_REQUEST_NUM="${PULL_REQUEST_NUM:-$1}"
+    COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$2}"
+    if [[ -z "${PULL_REQUEST_NUM}" || -z "${COMMENT_TRIGGER_TYPE}" ]]; then
+        echo "Usage: get_queue_build_of_pr PULL_REQUEST_NUM 
COMMENT_TRIGGER_TYPE" && return 1
+    fi
+
+    PIPELINE="${comment_to_pipeline[${COMMENT_TRIGGER_TYPE}]}"
+    local queue_builds_list
+    set -x
+    if ret=$(
+        curl -s -X GET \
+            -u OneMoreChance:OneMoreChance \
+            -H "Content-Type:text/plain" \
+            -H "Accept: application/json" \
+            
"http://43.132.222.7:8111/app/rest/buildQueue?locator=buildType:${PIPELINE}";
+    ); then
+        set +x
+        queue_builds_list=$(echo "${ret}" | jq ".build[] | select(.branchName 
== \"pull/${PULL_REQUEST_NUM}\") | .id")
+        echo "${queue_builds_list}"
+    else
+        set +x
+        echo "WARNING: failed to get queue build for PR ${PULL_REQUEST_NUM} of 
pipeline ${PIPELINE}" && return 1
+    fi
+}
+# get_queue_build_of_pr "$1" "$2"
+
+cancel_running_build() {
+    PULL_REQUEST_NUM="${PULL_REQUEST_NUM:-$1}"
+    COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$2}"
+    if [[ -z "${PULL_REQUEST_NUM}" || -z "${COMMENT_TRIGGER_TYPE}" ]]; then
+        echo "Usage: get_queue_build_of_pr PULL_REQUEST_NUM 
COMMENT_TRIGGER_TYPE" && return 1
+    fi
+
+    PIPELINE="${comment_to_pipeline[${COMMENT_TRIGGER_TYPE}]}"
+    local build_ids
+    if ! build_ids=$(get_running_build_of_pr "${PULL_REQUEST_NUM}" 
"${COMMENT_TRIGGER_TYPE}"); then return 1; fi
+    for id in ${build_ids}; do
+        set -x
+        if curl -s -X POST \
+            -u OneMoreChance:OneMoreChance \
+            -H "Content-Type:application/json" \
+            -H "Accept: application/json" \
+            "http://43.132.222.7:8111/app/rest/builds/id:${id}"; \
+            -d '{ "comment": "Canceling this running build before triggering a 
new one", "readdIntoQueue": false }'; then
+            set +x
+            echo -e "\nINFO: canceled running build(id ${id}) for PR 
${PULL_REQUEST_NUM} of pipeline ${PIPELINE}"
+        else
+            set +x
+            echo "WARNING: failed to cancel running build(id ${id}) for PR 
${PULL_REQUEST_NUM} of pipeline ${PIPELINE}"
+        fi
+    done
+}
+# cancel_running_build "$1" "$2"
+
+cancel_queue_build() {
+    PULL_REQUEST_NUM="${PULL_REQUEST_NUM:-$1}"
+    COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$2}"
+    if [[ -z "${PULL_REQUEST_NUM}" || -z "${COMMENT_TRIGGER_TYPE}" ]]; then
+        echo "Usage: get_queue_build_of_pr PULL_REQUEST_NUM 
COMMENT_TRIGGER_TYPE" && return 1
+    fi
+
+    PIPELINE="${comment_to_pipeline[${COMMENT_TRIGGER_TYPE}]}"
+    local build_ids
+    if ! build_ids=$(get_queue_build_of_pr "${PULL_REQUEST_NUM}" 
"${COMMENT_TRIGGER_TYPE}"); then return 1; fi
+    for id in ${build_ids}; do
+        set -x
+        if curl -s -X POST \
+            -u OneMoreChance:OneMoreChance \
+            -H "Content-Type:application/json" \
+            -H "Accept: application/json" \
+            "http://43.132.222.7:8111/app/rest/buildQueue/id:${id}"; \
+            -d '{ "comment": "Canceling this queued build before triggering a 
new one", "readdIntoQueue": false }'; then
+            set +x
+            echo -e "\nINFO: canceled queue build(id ${id}) for PR 
${PULL_REQUEST_NUM} of pipeline ${PIPELINE}"
+        else
+            set +x
+            echo "WARNING: failed to cancel queue build(id ${id}) for PR 
${PULL_REQUEST_NUM} of pipeline ${PIPELINE}"
+        fi
+    done
+}
+# cancel_queue_build "$1" "$2"
+
+skip_build() {
+    # 对于不需要跑teamcity pipeline的PR,直接调用github的接口返回成功
+    if [[ -z "${GITHUB_TOKEN}" ]]; then
+        echo "ERROR: env GITHUB_TOKEN not set"
+        return 1
+    fi
+    if [[ -z "$2" ]]; then
+        echo "Usage: skip_teamcity_pipeline COMMIT_ID_FROM_TRIGGER 
COMMENT_TRIGGER_TYPE"
+        return 1
+    fi
+    COMMIT_ID_FROM_TRIGGER="$1"
+    COMMENT_TRIGGER_TYPE="$2"
+
+    local state="${TC_BUILD_STATE:-success}" # 可选值 success failure pending
+    
payload="{\"state\":\"${state}\",\"target_url\":\"\",\"description\":\"Skip 
teamCity 
build\",\"context\":\"${conment_to_context[${COMMENT_TRIGGER_TYPE}]}\"}"
+    set -x
+    if curl -L \
+        -X POST \
+        -H "Accept: application/vnd.github+json" \
+        -H "Authorization: Bearer ${GITHUB_TOKEN:-}" \
+        -H "X-GitHub-Api-Version: 2022-11-28" \
+        
"https://api.github.com/repos/apache/doris/statuses/${COMMIT_ID_FROM_TRIGGER:-}";
 \
+        -d "${payload}"; then
+        set +x
+        echo "INFO: Skipped ${COMMIT_ID_FROM_TRIGGER} ${COMMENT_TRIGGER_TYPE}"
+    else
+        set +x
+        return 1
+    fi
+}
+# skip_build "$1" "$2"
+
+trigger_build() {
+    # 新触发一个build
+    PULL_REQUEST_NUM="${PULL_REQUEST_NUM:-$1}"
+    COMMIT_ID_FROM_TRIGGER="${COMMIT_ID_FROM_TRIGGER:-$2}"
+    COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$3}"
+    COMMENT_REPEAT_TIMES="${COMMENT_REPEAT_TIMES:-$4}"
+    if [[ -z "${PULL_REQUEST_NUM}" || -z "${COMMIT_ID_FROM_TRIGGER}" || -z 
"${COMMENT_TRIGGER_TYPE}" ]]; then
+        echo "Usage: add_build PULL_REQUEST_NUM COMMIT_ID_FROM_TRIGGER 
COMMENT_TRIGGER_TYPE [COMMENT_REPEAT_TIMES]"
+        return 1
+    fi
+    local PIPELINE
+    PIPELINE="${comment_to_pipeline[${COMMENT_TRIGGER_TYPE}]}"
+    set -x
+    if curl -s -X POST \
+        -u OneMoreChance:OneMoreChance \
+        -H "Content-Type:text/plain" \
+        -H "Accept: application/json" \
+        
"http://43.132.222.7:8111/httpAuth/action.html?add2Queue=${PIPELINE}&branchName=pull/${PULL_REQUEST_NUM}&name=env.commit_id_from_trigger&value=${COMMIT_ID_FROM_TRIGGER:-}&name=env.repeat_times_from_trigger&value=${COMMENT_REPEAT_TIMES:-1}";;
 then
+        set +x
+        echo "INFO: Add new build to PIPELINE ${PIPELINE} of PR 
${PULL_REQUEST_NUM} with COMMENT_REPEAT_TIMES ${COMMENT_REPEAT_TIMES:-1}"
+    else
+        set +x
+        return 1
+    fi
+}
+# trigger_build "$1" "$2" "$3" "$4"
+
+trigger_or_skip_build() {
+    # 根据相关文件是否修改,来触发or跳过跑流水线
+    FILE_CHANGED="$1"
+    PULL_REQUEST_NUM="${PULL_REQUEST_NUM:-$2}"
+    COMMIT_ID_FROM_TRIGGER="${COMMIT_ID_FROM_TRIGGER:-$3}"
+    COMMENT_TRIGGER_TYPE="${COMMENT_TRIGGER_TYPE:-$4}"
+    COMMENT_REPEAT_TIMES="${COMMENT_REPEAT_TIMES:-$5}"
+    if [[ -z "${FILE_CHANGED}" ||
+        -z "${PULL_REQUEST_NUM}" ||
+        -z "${COMMIT_ID_FROM_TRIGGER}" ||
+        -z "${COMMENT_TRIGGER_TYPE}" ]]; then
+        echo "Usage: add_build FILE_CHANGED PULL_REQUEST_NUM 
COMMIT_ID_FROM_TRIGGER COMMENT_TRIGGER_TYPE [COMMENT_REPEAT_TIMES]"
+        return 1
+    fi
+
+    if [[ "${FILE_CHANGED}" == "true" ]]; then
+        cancel_running_build "${PULL_REQUEST_NUM}" "${COMMENT_TRIGGER_TYPE}"
+        cancel_queue_build "${PULL_REQUEST_NUM}" "${COMMENT_TRIGGER_TYPE}"
+        trigger_build "${PULL_REQUEST_NUM}" "${COMMIT_ID_FROM_TRIGGER}" 
"${COMMENT_TRIGGER_TYPE}" "${COMMENT_REPEAT_TIMES}"
+    else
+        skip_build "${COMMIT_ID_FROM_TRIGGER}" "${COMMENT_TRIGGER_TYPE}"
+    fi
+}
+# trigger_or_skip_build "$1" "$2" "$3" "$4" "$5"


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to