From 6daafe5190b4f3c4d1eb52b7a6e176a38bc3933a Mon Sep 17 00:00:00 2001 From: liurenjie1024 Date: Wed, 20 Nov 2024 17:28:14 +0800 Subject: [PATCH] Fix --- .github/workflows/checkstyle.yml | 6 +++++- dev/checkstyle.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/checkstyle.yml b/.github/workflows/checkstyle.yml index 204674bf3..8b0074045 100644 --- a/.github/workflows/checkstyle.yml +++ b/.github/workflows/checkstyle.yml @@ -26,11 +26,15 @@ jobs: - uses: actions/checkout@v4 with: submodules: true + - name: Set up JDK uses: actions/setup-java@v4.5.0 with: java-version: '8' distribution: 'adopt' + + - name: Checkout base branch + run: git checkout ${{ github.base_ref }} + - name: Run checkstyle run: bash ./dev/checkstyle.sh - \ No newline at end of file diff --git a/dev/checkstyle.sh b/dev/checkstyle.sh index ab66ee4b9..41b5d5d72 100755 --- a/dev/checkstyle.sh +++ b/dev/checkstyle.sh @@ -20,7 +20,7 @@ set -ex # Assuming you are in the root of your git repository -MODIFIED_FILES=$(git diff --name-only HEAD~1) +MODIFIED_FILES=$(git diff --name-only "${GITHUB_BASE_REF}") SRC_DIR="src/main/java/" TEST_SRC_DIR="src/test/java/"