github-actions[bot] commented on code in PR #62534:
URL: https://github.com/apache/doris/pull/62534#discussion_r3090668182


##########
.github/workflows/license-eyes.yml:
##########
@@ -48,24 +48,27 @@ jobs:
         with:
           ref: ${{ github.event.pull_request.head.sha }}
 
-      - name: Fetch base branch for diff
-        if: github.event_name == 'pull_request_target'
-        run: git fetch --no-tags --depth=1 origin ${{ github.base_ref }}
-
       - name: Get changed files
         if: github.event_name == 'pull_request_target'
         id: changed-files
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         run: |
-          base_sha=$(git rev-parse FETCH_HEAD)
-          if ! all=$(git diff --name-only "${base_sha}...HEAD" 2>/dev/null); 
then
+          if ! all=$(gh api repos/${{ github.repository }}/pulls/${{ 
github.event.pull_request.number }}/files \
+            --paginate --jq '.[].filename' 2>/dev/null); then
+            echo "config_file=.licenserc.yaml" >> "$GITHUB_OUTPUT"
+            exit 0
+          fi
+          if [ "$(echo "$all" | wc -l)" -ge 3000 ]; then
             echo "config_file=.licenserc.yaml" >> "$GITHUB_OUTPUT"
             exit 0
           fi
           if echo "$all" | grep -qxF '.licenserc.yaml'; then
             echo "config_file=.licenserc.yaml" >> "$GITHUB_OUTPUT"
             exit 0
           fi
-          acmr=$(git diff --name-only --diff-filter=ACMR "${base_sha}...HEAD")
+          acmr=$(gh api repos/${{ github.repository }}/pulls/${{ 
github.event.pull_request.number }}/files \

Review Comment:
   This second `gh api` call is now a new failure point in the PR path. Unlike 
the first one, it is not wrapped in a fallback, and GitHub Actions runs `run:` 
steps under `bash -e`, so a transient API error here will fail the whole job 
instead of falling back to the full `.licenserc.yaml` scan. Please either reuse 
the first API response, or give this call the same fallback behavior.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to