github-actions[bot] commented on code in PR #62232:
URL: https://github.com/apache/doris/pull/62232#discussion_r3064290454
##########
.github/workflows/license-eyes.yml:
##########
@@ -48,7 +48,52 @@ 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
+ run: |
+ git diff --name-only origin/${{ github.base_ref }}...HEAD | grep
-qxF '.licenserc.yaml' \
Review Comment:
`git diff origin/${{ github.base_ref }}...HEAD` still depends on the merge
base being present locally. In this workflow the PR head is checked out with
`actions/checkout@v3`'s default shallow history, and the new fetch also uses
`--depth=1`, so for ordinary fork PRs there is usually still no common ancestor
in the local clone. I reproduced that exact state here: after `git fetch
--no-tags --depth=1 origin master`, `git diff --name-only origin/master...HEAD`
fails with `fatal: origin/master...HEAD: no merge base`. That means
changed-file detection still aborts before the license check runs. Please
either fetch enough history (`fetch-depth: 0` or deepen until `git merge-base`
succeeds) or switch to a diff strategy based on explicit base/head SHAs that
does not require a locally available merge base.
--
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]