github-actions[bot] commented on code in PR #62232:
URL: https://github.com/apache/doris/pull/62232#discussion_r3064470502
##########
.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 FETCH_HEAD...HEAD | grep -qxF '.licenserc.yaml'
\
+ && echo "licenserc_changed=true" >> "$GITHUB_OUTPUT" || true
+ {
+ echo "added_modified<<EOF"
+ git diff --name-only --diff-filter=ACMR FETCH_HEAD...HEAD
Review Comment:
This rename handling is still incomplete. `git diff --name-only` reports
only the destination path for renames, so a PR that renames `.licenserc.yaml`
to some other filename will not match the `grep -qxF '.licenserc.yaml'` check
above. Then `licenserc_changed` stays false and the next step still tries to
`open('.licenserc.yaml')`, which fails. The PR description says
add/modify/delete/rename are covered, but rename-away of `.licenserc.yaml` is
still missed here.
##########
.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 FETCH_HEAD...HEAD | grep -qxF '.licenserc.yaml'
\
Review Comment:
`FETCH_HEAD...HEAD` still uses a triple-dot diff, which requires Git to
compute a local merge base. On the `pull_request_target` checkout we only have
the head commit plus a depth-1 fetch of the base tip, so there is often no
shared history locally and this command still dies with `fatal: ... no merge
base`. I reproduced that with a shallow clone and a single extra fetch of the
base branch. As written, this can make the license job fail on shallow PR runs
instead of falling back to the incremental scan.
--
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]