From 042f15ffbd7598c5b7beaf87d4ede45f8efc0aa3 Mon Sep 17 00:00:00 2001 From: granny Date: Tue, 6 Aug 2024 10:37:26 -0700 Subject: [PATCH] [ci skip] chore: fix incorrect commit hash in PR builds (#11198) * fix incorrect hash in PR builds * only apply ref on pull_request triggers --- .github/workflows/build.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cef01ede78..09a170d7fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,12 @@ jobs: java: [21] fail-fast: true steps: - - uses: actions/checkout@v4 + - if: ${{ github.event_name == 'push' }} + uses: actions/checkout@v4 + - if: ${{ github.event_name == 'pull_request' }} + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} - name: JDK ${{ matrix.java }} uses: actions/setup-java@v4 with: