This is an automated email from the ASF dual-hosted git repository.
hellostephen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new c491c8ad169 [ci](fix) license check (#62495)
c491c8ad169 is described below
commit c491c8ad169323fb867ab5770a8fd37879371978
Author: Dongyang Li <[email protected]>
AuthorDate: Wed Apr 15 21:17:50 2026 +0800
[ci](fix) license check (#62495)
---
.github/workflows/license-eyes.yml | 39 +++++++++++++++++++++++++++++++-------
1 file changed, 32 insertions(+), 7 deletions(-)
diff --git a/.github/workflows/license-eyes.yml
b/.github/workflows/license-eyes.yml
index b0470ef5c6c..ca77bda309c 100644
--- a/.github/workflows/license-eyes.yml
+++ b/.github/workflows/license-eyes.yml
@@ -48,17 +48,40 @@ 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
- uses: tj-actions/changed-files@v45
- with:
- separator: "\n"
+ run: |
+ base_sha=$(git rev-parse FETCH_HEAD)
+ if ! all=$(git diff --name-only "${base_sha}...HEAD" 2>/dev/null);
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")
+ if [ -z "$acmr" ]; then
+ exit 0
+ fi
+ {
+ echo "added_modified<<EOF"
+ echo "$acmr"
+ echo "EOF"
+ } >> "$GITHUB_OUTPUT"
+ echo "config_file=.licenserc-incremental.yaml" >> "$GITHUB_OUTPUT"
- name: Generate incremental licenserc
- if: github.event_name == 'pull_request_target' &&
steps.changed-files.outputs.all_changed_files != ''
+ if: >-
+ github.event_name == 'pull_request_target' &&
+ steps.changed-files.outputs.added_modified != ''
env:
- CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
+ CHANGED_FILES: ${{ steps.changed-files.outputs.added_modified }}
run: |
python3 - <<'EOF'
import yaml, os
@@ -76,9 +99,11 @@ jobs:
EOF
- name: Check License
- if: github.event_name != 'pull_request_target' ||
steps.changed-files.outputs.all_changed_files != ''
+ if: >-
+ github.event_name != 'pull_request_target' ||
+ steps.changed-files.outputs.config_file != ''
uses: apache/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
- config: ${{ github.event_name == 'pull_request_target' &&
'.licenserc-incremental.yaml' || '.licenserc.yaml' }}
+ config: ${{ steps.changed-files.outputs.config_file ||
'.licenserc.yaml' }}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]