Skip to content

Commit fe56305

Browse files
committed
[fix](build) Fix license check diff in shallow clones
### What problem does this PR solve? Issue Number: Related PR: apache#62410 Problem Summary: License Check falls back to full-repo scan when git diff fails under shallow fetch, causing unrelated pre-existing files to fail the PR. Fetch full history for PR head and base to reliably generate incremental config. ### Release note None ### Check List (For Author) - Test: No need to test (GitHub Actions) - Behavior changed: No - Does this need documentation: No
1 parent 0f29f35 commit fe56305

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎.github/workflows/license-eyes.yml‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,19 @@ jobs:
4141
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
4242
if: ${{ github.event_name != 'pull_request_target' }}
4343
uses: actions/checkout@v3
44+
with:
45+
fetch-depth: 0
4446

4547
- name: Checkout ${{ github.ref }} ( ${{ github.event.pull_request.head.sha }} )
4648
if: ${{ github.event_name == 'pull_request_target' }}
4749
uses: actions/checkout@v3
4850
with:
4951
ref: ${{ github.event.pull_request.head.sha }}
52+
fetch-depth: 0
5053

5154
- name: Fetch base branch for diff
5255
if: github.event_name == 'pull_request_target'
53-
run: git fetch --no-tags --depth=1 origin ${{ github.base_ref }}
56+
run: git fetch --no-tags origin ${{ github.base_ref }}
5457

5558
- name: Get changed files
5659
if: github.event_name == 'pull_request_target'

0 commit comments

Comments
 (0)