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

lizhimins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new 189d2d56 fix(ci): fix paths-filter shallow clone failure and cpp 
coverage token (#1262)
189d2d56 is described below

commit 189d2d563cc315062bfa6858c89b557c111335c0
Author: lizhimins <[email protected]>
AuthorDate: Tue Jun 9 11:13:45 2026 +0800

    fix(ci): fix paths-filter shallow clone failure and cpp coverage token 
(#1262)
    
    - Add fetch-depth: 2 to checkout so HEAD~1 is available for push events
    - Add CODECOV_ACTION_KEY token to cpp coverage upload (required for 
protected branches)
    - Migrate deprecated ::set-output to $GITHUB_OUTPUT
---
 .github/workflows/build.yml        | 37 +++++++++++++++++++------------------
 .github/workflows/cpp_coverage.yml |  1 +
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 4a625946..c97f2ffd 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -22,6 +22,8 @@ jobs:
       nodejs: ${{ steps.nodejs.outputs.nodejs }}
     steps:
       - uses: actions/checkout@v4
+        with:
+          fetch-depth: 2
       - name: Get changed files (Push/Pull Request)
         id: changed_files
         env:
@@ -32,85 +34,84 @@ jobs:
             REPO_OWNER=${{ github.repository_owner }}
             REPO_NAME=${{ github.event.repository.name }}
 
-            # calling GitHub API for changed files in PR, the result is in 
string format.
             CHANGED_FILES=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
               
"https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER/files"; | \
               jq -r '.[].filename' | tr '\n' ' ')
           else
             CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
           fi
-          echo "::set-output name=files::$CHANGED_FILES"
+          echo "files=$CHANGED_FILES" >> "$GITHUB_OUTPUT"
 
       - name: Check Java changes
         id: java
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n'| 
grep -qE '^(java/|pom.xml)'; then
-            echo "::set-output name=java::true"
+            echo "java=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=java::false"
+            echo "java=false" >> "$GITHUB_OUTPUT"
           fi
 
       - name: Check C++ changes
         id: cpp
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n'| 
grep -qE '^cpp/'; then
-            echo "::set-output name=cpp::true"
+            echo "cpp=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=cpp::false"
+            echo "cpp=false" >> "$GITHUB_OUTPUT"
           fi
 
       - name: Check Golang changes
         id: golang
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n' | 
grep -qE '^golang/'; then
-            echo "::set-output name=golang::true"
+            echo "golang=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=golang::false"
+            echo "golang=false" >> "$GITHUB_OUTPUT"
           fi
 
       - name: Check C# changes
         id: csharp
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n' | 
grep -qE '^csharp/'; then
-            echo "::set-output name=csharp::true"
+            echo "csharp=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=csharp::false"
+            echo "csharp=false" >> "$GITHUB_OUTPUT"
           fi
 
       - name: Check PHP changes
         id: php
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n' | 
grep -qE '^php/'; then
-            echo "::set-output name=php::true"
+            echo "php=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=php::false"
+            echo "php=false" >> "$GITHUB_OUTPUT"
           fi
 
       - name: Check Rust changes
         id: rust
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n' | 
grep -qE '^rust/'; then
-            echo "::set-output name=rust::true"
+            echo "rust=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=rust::false"
+            echo "rust=false" >> "$GITHUB_OUTPUT"
           fi
 
       - name: Check Python changes
         id: python
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n' | 
grep -qE '^python/'; then
-            echo "::set-output name=python::true"
+            echo "python=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=python::false"
+            echo "python=false" >> "$GITHUB_OUTPUT"
           fi
 
       - name: Check Node.js changes
         id: nodejs
         run: |
           if echo "${{ steps.changed_files.outputs.files }}" | tr  ' ' '\n' | 
grep -qE '^nodejs/'; then
-            echo "::set-output name=nodejs::true"
+            echo "nodejs=true" >> "$GITHUB_OUTPUT"
           else
-            echo "::set-output name=nodejs::false"
+            echo "nodejs=false" >> "$GITHUB_OUTPUT"
           fi
   java-build:
     needs: [paths-filter]
diff --git a/.github/workflows/cpp_coverage.yml 
b/.github/workflows/cpp_coverage.yml
index be1f1f85..41521112 100644
--- a/.github/workflows/cpp_coverage.yml
+++ b/.github/workflows/cpp_coverage.yml
@@ -62,6 +62,7 @@ jobs:
       - name: Upload to Codecov
         uses: codecov/codecov-action@v4
         with:
+          token: ${{ secrets.CODECOV_ACTION_KEY }}
           file: ./cpp/coverage.info
           flags: cpp
           fail_ci_if_error: true

Reply via email to