github-actions[bot] commented on code in PR #62232:
URL: https://github.com/apache/doris/pull/62232#discussion_r3064204284
##########
.github/workflows/license-eyes.yml:
##########
@@ -48,7 +48,44 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
+ - 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' \
+ && echo "licenserc_changed=true" >> "$GITHUB_OUTPUT" || true
+ echo "added_modified=$(git diff --name-only --diff-filter=ACMR
origin/${{ github.base_ref }}...HEAD)" >> "$GITHUB_OUTPUT"
Review Comment:
`$GITHUB_OUTPUT` only accepts `name=value` for single-line values. Here `git
diff --name-only --diff-filter=ACMR ...` returns one file per line, so for any
PR that touches 2+ files the second and later paths are written as standalone
lines instead of part of `added_modified`. That either truncates the file list
or makes the step fail with an invalid output format before the license check
runs. Please switch this to the documented multiline form
(`added_modified<<EOF` ... `EOF`) or encode the list onto one line before
writing it.
##########
.github/workflows/license-eyes.yml:
##########
@@ -48,7 +48,44 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
+ - 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:
This diff assumes `origin/${{ github.base_ref }}` exists locally, but the PR
checkout above only fetches `${{ github.event.pull_request.head.sha }}`. On
`pull_request_target` runs for forked PRs that often means there is no local
`origin/master`, so `git diff origin/${{ github.base_ref }}...HEAD` fails with
`fatal: bad revision` and blocks the whole workflow. Please fetch the base ref
explicitly (or use the GitHub API/event payload for changed files) before
relying on this revision range.
--
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]